A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-checkins/2002-October/030050.html below:

[Python-checkins] python/dist/src/Objects typeobject.c,2.126.4.23,2.126.4.24

[Python-checkins] python/dist/src/Objects typeobject.c,2.126.4.23,2.126.4.24gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Mon, 07 Oct 2002 11:08:29 -0700
Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv14033/Objects

Modified Files:
      Tag: release22-maint
	typeobject.c 
Log Message:
Backport, at the reqest of Kevin Jacobs:

- Changed new-style class instantiation so that when C's __new__
  method returns something that's not a C instance, its __init__ is
  not called.  [SF bug #537450]

XXX This is arguably a semantic change, but it's hard to imagine a
reason for wanting to depend on the old behavior.  If problems with
this are reported within a week of the release of 2.2.2 beta 1, we may
revert this change.


Index: typeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v
retrieving revision 2.126.4.23
retrieving revision 2.126.4.24
diff -C2 -d -r2.126.4.23 -r2.126.4.24
*** typeobject.c	14 Aug 2002 17:36:26 -0000	2.126.4.23
--- typeobject.c	7 Oct 2002 18:08:27 -0000	2.126.4.24
***************
*** 190,193 ****
--- 190,197 ----
  		     (PyDict_Check(kwds) && PyDict_Size(kwds) == 0)))
  			return obj;
+ 		/* If the returned object is not an instance of type,
+ 		   it won't be initialized. */
+ 		if (!PyType_IsSubtype(obj->ob_type, type))
+ 			return obj;
  		type = obj->ob_type;
  		if (PyType_HasFeature(type, Py_TPFLAGS_HAVE_CLASS) &&





RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4