Talin wrote: > def x(): > scope = object() > scope.x = 1 > def y(): > scope.x = 2
'object' doesn't let you set custom attributes.
Here's what I normally use in my code...
class Data : pass
def x() :
d = Data()
d.x = 1
def y() :
d.x += 1
Regards
Sreeram
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
