Phillip J. Eby wrote:
That test is there to ensure that it interoperates with code using the
AddOns library from the Cheeseshop; SQLAlchemy is not the source of the
usage.
Now that's interesting. The AddOns library uses class objects as keys in
the __dict__, but that doesn't says anything about the usage of
locals(). At no point in the AddOns library is locals() abused like
this, so even if one asserts that assignment to the dict returned by
locals() is a bug, the underlying behavior of interest is whether
__dict__ is allowed to have non-string keys.
>>> from peak.util.addons import AddOn
>>> class C: pass
>>> class A(AddOn): pass
>>> spam = C()
>>> print spam.__dict__
{}
>>> A(spam)
>>> print spam.__dict__
{<class 'A'>: <A object at ...>}
If non-string keys are not allowed in __dict__, then the AddOns library
should be changed to add another dict to the object of interest to track
these AddOn instances.
-Scott
--
Scott Dial
[EMAIL PROTECTED]
[EMAIL PROTECTED]
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com