Weird behavior with lexical scope

skip at pobox.com skip at pobox.com
Thu Nov 6 13:10:41 EST 2008


    >> def __init__(self, Inner=Inner):
    Steve> Ok, the Inner=Inner trick works. What the heck does that do, anyway?
    Steve> I've never seen that formulation.

Understanding that will put you on the path to scoping enlightenment.
Consider when that default assignment is established and how that might
differ from the assignment that occurs when __init__ is called.

Skip




More information about the Python-list mailing list