This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lpd
Recipients lpd
Date 2008-01-04.05:50:39
SpamBayes Score 0.0295817
Marked as misclassified No
Message-id <>
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
Date User Action Args
2008-01-04 05:50:40lpdsetspambayes_score: 0.0295817 -> 0.0295817
recipients: + lpd
2008-01-04 05:50:39lpdsetspambayes_score: 0.0295817 -> 0.0295817
messageid: <>
2008-01-04 05:50:39lpdlinkissue1734 messages
2008-01-04 05:50:39lpdcreate