[Python-bugs-list] [ python-Bugs-642358 ] metaclass causes __dict__ to be dict
SourceForge.net
noreply@sourceforge.net
Mon, 06 Jan 2003 15:02:51 -0800
Bugs item #642358, was opened at 2002-11-22 11:18
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=642358&group_id=5470
Category: Python Interpreter Core
Group: None
Status: Open
Resolution: None
>Priority: 9
Submitted By: Jeremy Hylton (jhylton)
Assigned to: Guido van Rossum (gvanrossum)
Summary: metaclass causes __dict__ to be dict
Initial Comment:
class Meta(type):
def __new__(meta, name, bases, dict):
return super(Meta, name).__new__(meta, name,
bases, dict)
class AClass:
__metaclass__ = Meta
print type(AClass.__dict__)
With 2.2.2, this prints dict-proxy.
With 2.3, this prints dict.
As you noted, it should always be a dict-proxy to
prevent people from getting the __dict__ and the tp
slots out of sync.
----------------------------------------------------------------------
>Comment By: Guido van Rossum (gvanrossum)
Date: 2003-01-06 18:02
Message:
Logged In: YES
user_id=6380
I should address this next, since it apparently causes Zope3
problems.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=642358&group_id=5470