Why I love python.

Nick Patavalis npat at efault.net
Fri Aug 13 14:33:31 EDT 2004


On 2004-08-13, Reinhold Birkenfeld 
<reinhold-birkenfeld-nospam at wolke7.net> wrote:
>
> I think the dynamic nature does make it impossible to do anything in
> such cases at the first place. Consider:
>
> klass = raw_input()
> classobj = eval(klass + "()")
> print classobj.whatami
>

Yes, that's exactly what I meant. The only solution in such a case
would be for the environment to call the compiler at run time, and
compile classobj then. This means of course that in such cases the
compiler must be included in the "executable".

I believe this has been done in other dynamic languages.

Typed-extensions, as you mention, would also help.

/npat



More information about the Python-list mailing list