Eric Snow added the comment: We should definitely have a way to expose the original dictionary from __prepare__(). Along with Nick's point, another reason is to allow class decorators to have access to that original, which is important to any use case that involves post-creation introspection of the definition order within the class namespace.
Nick, where did you see cls.__locals__? I'm not finding any mention of __locals__ outside compiler.c and symtable.c. I agree that such an attribute on classes would be helpful, even if by another name, and that it should be documented. ---------- nosy: +eric.snow _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue17044> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com