hack to auto-define variables?

Samuel A. Falvo II kc5tja at garnet.armored.net
Thu Oct 12 18:21:19 EDT 2000


On Thu, 5 Oct 2000 11:27:04 -0700, Neil Schemenauer wrote:
>Python is not Perl.  Why do you want this?

Having something like this would be exceptionally handy when developing more
complicated class hierarchies.  I quite often find myself in need of a new
instance variable when I'm deep down inside a method implementation.  If the
variable needs to be in a base class, then serious re-editing is necessary.

I would, however, like to add something to the semantics requested: I'd like
it to generate a log entry everytime it does this.  So, say for example:

>>> x
*** Variable `x' implicitly declared in __main__, line ??
None

This way, during the course of running the application being developed, I
can examine the log files to see if I need to do any source code cleanup.

-- 
KC5TJA/6, DM13, QRP-L #1447 | Official Channel Saint, *Team Amiga*
Samuel A. Falvo II	    |
Oceanside, CA		    |



More information about the Python-list mailing list