A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2004-March/043024.html below:

[Python-Dev] PEP 318 - generality of list; restrictions on elements

[Python-Dev] PEP 318 - generality of list; restrictions on elements [Python-Dev] PEP 318 - generality of list; restrictions on elementsPhillip J. Eby pje at telecommunity.com
Wed Mar 10 11:10:21 EST 2004
At 10:31 AM 3/10/04 -0500, Aahz wrote:
>Maybe I'm misunderstanding something.  I thought that a property contains
>a get descriptor, which makes it a kind of callable.  Read-only
>properties contain a set descriptor that either does nothing or raises an
>exception.  That doesn't affect whether the property is classified as a
>callable.

Properties are not callable.

Python 2.2.2 (#37, Oct 14 2002, 17:02:34) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
IDLE 0.8 -- press F1 for help
 >>> x=property()
 >>> x()
Traceback (most recent call last):
   File "<pyshell#1>", line 1, in ?
     x()
TypeError: 'property' object is not callable
 >>> callable(property())
0
 >>> callable(property(lambda x:None))
0
 >>>



More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4