]> granicus.if.org Git - python/commit
Make properties discoverable from Python:
authorTim Peters <tim.peters@gmail.com>
Mon, 24 Sep 2001 21:17:50 +0000 (21:17 +0000)
committerTim Peters <tim.peters@gmail.com>
Mon, 24 Sep 2001 21:17:50 +0000 (21:17 +0000)
commit66c1a525e08fda439ddda3b6371236df1398cfd5
tree9ac8e6d2fda99e406a40b281ae315d686a570c53
parent30c484916988862608e4efdfa8f8aa911e4cc0c3
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.
Lib/test/test_descr.py
Misc/NEWS
Objects/descrobject.c