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 <1199425839.96.0.974178478266.issue1734@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
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: <1199425839.96.0.974178478266.issue1734@psf.upfronthosting.co.za>
2008-01-04 05:50:39lpdlinkissue1734 messages
2008-01-04 05:50:39lpdcreate