[Python-checkins] python/dist/src/Misc NEWS,1.656,1.657

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Thu, 13 Feb 2003 08:30:23 -0800


Update of /cvsroot/python/python/dist/src/Misc
In directory sc8-pr-cvs1:/tmp/cvs-serv22067

Modified Files:
	NEWS 
Log Message:
SF patch #685738 by Michael Stone.

This changes the default __new__ to refuse arguments iff tp_init is the
default __init__ implementation -- thus making it a TypeError when you
try to pass arguments to a constructor if the class doesn't override at
least __init__ or __new__.


Index: NEWS
===================================================================
RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v
retrieving revision 1.656
retrieving revision 1.657
diff -C2 -d -r1.656 -r1.657
*** NEWS	12 Feb 2003 21:46:11 -0000	1.656
--- NEWS	13 Feb 2003 16:30:16 -0000	1.657
***************
*** 13,16 ****
--- 13,22 ----
  -----------------
  
+ - If a new-style class defines neither __new__ nor __init__, its
+   constructor would ignore all arguments.  This is changed now: the
+   constructor refuses arguments in this case.  This might break code
+   that worked under Python 2.2.  The simplest fix is to add a no-op
+   __init__: "def __init__(self, *args, **kw): pass".
+ 
  - Through a bytecode optimizer bug (and I bet you didn't even know
    Python *had* a bytecode optimizer :-), "unsigned" hex/oct constants