summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-09-22 17:10:44 (GMT)
committerGuido van Rossum <guido@python.org>2001-09-22 17:10:44 (GMT)
commit380bad1b4e363f3b7c23677981e19e1fa3aded1b (patch)
treebd80236d5d29b629bcbe03ae0f45c1198b9ae77d /Misc
parente0b2d7ac9aea548d0bee1cdabd5d7b1254a6569d (diff)
downloadcpython-380bad1b4e363f3b7c23677981e19e1fa3aded1b.zip
cpython-380bad1b4e363f3b7c23677981e19e1fa3aded1b.tar.gz
cpython-380bad1b4e363f3b7c23677981e19e1fa3aded1b.tar.bz2
Add note about __getattribute__.
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS9
1 files changed, 9 insertions, 0 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 47cf1f1..713eb17 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -19,6 +19,15 @@ Core
constructor, with the same signature as the builtin open() function.
file() is now the preferred way to open a file.
+- In 2.2a3, *for new-style classes only*, __getattr__ was called for
+ every attribute access. This was confusing because it differed
+ significantly from the behavior of classic classes, where it was
+ only called for missing attributes. Now, __getattr__ is called only
+ if regular attribute access raises AttributeError; to catch *all*
+ attribute access, *for new-style classes only*, you can use
+ __getattribute__. If both are defined, __getattribute__ is called
+ first, and if it raises AttributeError, __getattr__ is called.
+
- In 2.2a3, __new__ would only see sequential arguments passed to the
type in a constructor call; __init__ would see both sequential and
positional arguments. This made no sense whatsoever any more, so