diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-09-24 21:17:50 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-09-24 21:17:50 (GMT) |
commit | 66c1a525e08fda439ddda3b6371236df1398cfd5 (patch) | |
tree | 9ac8e6d2fda99e406a40b281ae315d686a570c53 /Misc | |
parent | 30c484916988862608e4efdfa8f8aa911e4cc0c3 (diff) | |
download | cpython-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/NEWS | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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 |