Self in Interactive Interpreter
fredrik at pythonware.com
Fri Apr 4 22:41:04 CEST 2008
> For years it has been a slight annoyance that every time I wanted to
> test a snippet of code from a class by running it in the interactive
> interpreter, I had to remove all of the self. instances from the
> code. After I got it working correctly, I had to put all the self.'s
> back into the code to put it back into my class.
wouldn't it be a lot easier to test your code by importing the module
containing it into the interactive interpreter?
>>>> class dummy:
>>>> def __init__(self):
>>> class dummy: pass
More information about the Python-list