summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-09-24 21:17:50 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-09-24 21:17:50 (GMT)
commit66c1a525e08fda439ddda3b6371236df1398cfd5 (patch)
tree9ac8e6d2fda99e406a40b281ae315d686a570c53 /Misc
parent30c484916988862608e4efdfa8f8aa911e4cc0c3 (diff)
downloadcpython-66c1a525e08fda439ddda3b6371236df1398cfd5.zip
cpython-66c1a525e08fda439ddda3b6371236df1398cfd5.tar.gz
cpython-66c1a525e08fda439ddda3b6371236df1398cfd5.tar.bz2
Make properties discoverable from Python:
- property() now takes 4 keyword arguments: fget, fset, fdel, doc. Note that the real purpose of the 'f' prefix is to make fdel fit in ('del' is a keyword, so can't used as a keyword argument name). - These map to visible readonly attributes 'fget', 'fset', 'fdel', and '__doc__' in the property object. - fget/fset/fdel weren't discoverable from Python before. - __doc__ is new, and allows to associate a docstring with a property.
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 7e0234f..3691616 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -3,6 +3,12 @@ What's New in Python 2.2a4?
Core
+- property() now takes 4 keyword arguments: fget, fset, fdel and doc.
+ These map to readonly attributes 'fget', 'fset', 'fdel', and '__doc__'
+ in the constructed property object. fget, fset and fdel weren't
+ discoverable from Python in 2.2a3. __doc__ is new, and allows to
+ associate a docstring with a property.
+
- file.writelines() now accepts any iterable object producing strings.
- PyUnicode_FromEncodedObject() now works very much like