[Python-bugs-list] [ python-Bugs-452832 ] object.__new__ too dangerous

noreply@sourceforge.net noreply@sourceforge.net
Sat, 18 Aug 2001 23:07:41 -0700


Bugs item #452832, was opened at 2001-08-18 22:47
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=452832&group_id=5470

Category: Type/class unification
Group: Python 2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Guido van Rossum (gvanrossum)
Assigned to: Guido van Rossum (gvanrossum)
Summary: object.__new__ too dangerous

Initial Comment:
object.__new__(type) or object.__new__(dictionary)
creates insufficiently initialized objects. Not clear
what to do about that -- this is supposed to be called
only from a subclass constructor, but how do I verify
that?


----------------------------------------------------------------------

>Comment By: Skip Montanaro (montanaro)
Date: 2001-08-18 23:07

Message:
Logged In: YES 
user_id=44345

(Just thinking out loud before I trundle off to bed...)

Can you call (the equivalent of) sys._getframe, then from
there work your way back to a method object and check that
the method is named __init__ and that its first argument is
an instance of a subclass of object?  Sounds messy.


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=452832&group_id=5470