creating class objects inside methods

horos11 horos11 at gmail.com
Sun Oct 4 02:14:08 EDT 2009


Carl,

Thanks for the info, but a couple of points:

    1. it wasn't meant to be production code, simply a way to teach
python.

    2. this should either be a compile time or a runtime error.

'Actions at a distance' like this are deadly both to productivity and
to correctness - not only is this a runtime error, it is a *silent*
runtime error. Any other language I know would catch this, whether it
be lua, java, or perl.

Saying that 'whoa, this coding error should be handled by naming
convention' may be the only practical way of getting around this
limitation, but it is a limitation nonetheless, and a pretty big one.

Ed



O



More information about the Python-list mailing list