[Python-Dev] Object customization (was: Arbitrary attributes on funcs and methods)
Skip Montanaro
skip@mojam.com (Skip Montanaro)
Fri, 14 Apr 2000 09:39:27 -0500 (CDT)
>> Yes, of course people will use it to get the effect of function
>> statics. OK by me. People do the same thing today with class data
>> attributes (i.e., to
AMK> Wait, the attributes added to a function are visible inside the
AMK> function? (I haven't looked that closely at the patch?)
No, they aren't. There is no change of Python's scoping rules using Barry's
function attributes patch. In fact, they are *only* available to the
function itself via the function's name in the module globals. That's why
Fredrik's "eff, bot = bot, eff" trick worked as it did.
--
Skip Montanaro | http://www.mojam.com/
skip@mojam.com | http://www.musi-cal.com/