summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2003-02-13 16:30:16 (GMT)
committerGuido van Rossum <guido@python.org>2003-02-13 16:30:16 (GMT)
commit298e4214538a7196c27ec22b1f01506fdb3c4039 (patch)
tree6d75d061df43965e30b132c378802c5488fd8f64 /Misc
parent0c016a9590b3da47f19420d0616e0c72cae19abf (diff)
downloadcpython-298e4214538a7196c27ec22b1f01506fdb3c4039.zip
cpython-298e4214538a7196c27ec22b1f01506fdb3c4039.tar.gz
cpython-298e4214538a7196c27ec22b1f01506fdb3c4039.tar.bz2
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__.
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS6
1 files changed, 6 insertions, 0 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index cfcb7ac..dc6f1db 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,12 @@ What's New in Python 2.3 alpha 2?
Core and builtins
-----------------
+- 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
with a leading minus sign would come out with the wrong sign.