New submission from L. Peter Deutsch: In the following, dir(Node) should include the name 'z', and Node.z should be 'Node'. However, dir(Node) does not include 'z', and Node.z is undefined (AttributeError). This is directly contrary to the Python documentation, which says "metaclasses can modify dict".
class MetaNode(type): def __init__(cls, name, bases, cdict): cdict['z'] = name type.__init__(name, bases, cdict) class Node(object): __metaclass__ = MetaNode print dir(Node) print Node.z ---------- components: Interpreter Core messages: 59216 nosy: lpd severity: normal status: open title: no effect if metaclass modifies dict versions: Python 2.5 __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1734> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com