[Python-checkins] python/dist/src/Misc NEWS,1.1289,1.1290

bcannon at users.sourceforge.net bcannon at users.sourceforge.net
Tue Apr 26 05:45:32 CEST 2005


Update of /cvsroot/python/python/dist/src/Misc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16821/Misc
Modified Files:
	NEWS 
Log Message:
Make subclasses of int, long, complex, float, and unicode perform type
conversion using the proper magic slot (e.g., __int__()). Also move conversion
code out of PyNumber_*() functions in the C API into the nb_* function.
Applied patch #1109424. Thanks Walter Doewald.
Index: NEWS
===================================================================
RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v
retrieving revision 1.1289
retrieving revision 1.1290
diff -u -d -r1.1289 -r1.1290
--- NEWS	25 Apr 2005 07:13:45 -0000	1.1289
+++ NEWS	26 Apr 2005 03:45:26 -0000	1.1290
@@ -12,6 +12,14 @@
 Core and builtins
 -----------------
 
+- patch #1109424: int, long, float, complex, and unicode now check for the
+ proper magic slot for type conversions when subclassed. Previously the
+ magic slot was ignored during conversion. Semantics now match the way
+ subclasses of str always behaved. int/long/float, conversion of an instance
+ to the base class has been moved the prroper nb_* magic slot and out of
+ PyNumber_*().
+ Thanks Walter Dörwald.
+
 - Descriptors defined in C with a PyGetSetDef structure, where the setter is
 NULL, now raise an AttributeError when attempting to set or delete the
 attribute. Previously a TypeError was raised, but this was inconsistent


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /