overriding a property

John Posner jjposner at optimum.net
Wed Oct 20 10:18:52 EDT 2010


On 10/20/2010 9:59 AM, Lucasm wrote:

<snip>

> Thanks for the answers. I would like to override the property though
> without making special modifications in the main class beforehand. Is
> this possible?

Take a look at http://docs.python.org/reference/datamodel.html#descriptors

The last paragraph of Section 3.4.2.3. Invoking Descriptors says:

   The property() function is implemented as a data descriptor.
   Accordingly, instances cannot override the behavior of a property.

-John



More information about the Python-list mailing list