[Python-bugs-list] [ python-Bugs-535170 ] new.instance() breaks with new classes
noreply@sourceforge.net
noreply@sourceforge.net
Tue, 26 Mar 2002 04:49:35 -0800
Bugs item #535170, was opened at 2002-03-26 23:49
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=535170&group_id=5470
Category: Python Interpreter Core
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Anthony Baxter (anthonybaxter)
Assigned to: Nobody/Anonymous (nobody)
Summary: new.instance() breaks with new classes
Initial Comment:
>>> class a1: pass
...
>>> a2 = type('a2', (), {})
>>> class a3(object): pass
...
>>> a1
<class __main__.a1 at 0x815111c>
>>> a2
<class '__main__.a2'>
>>> a3
<class '__main__.a3'>
>>> import new
>>> new.instance(a1)
<__main__.a1 instance at 0x8148a04>
>>> new.instance(a2)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: instance() argument 1 must be class, not type
>>> new.instance(a3)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: instance() argument 1 must be class, not type
2.2 branch and current CVS... _so_ not a 2.2 bugfix
necessity, tho :)
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=535170&group_id=5470