Override property setter of base class in Python 3

Chris Angelico rosuav at gmail.com
Sun Sep 11 08:03:08 EDT 2016


On Sun, Sep 11, 2016 at 9:17 PM, Nagy László Zsolt <gandalf at shopzeus.com> wrote:
>> Subclassing and overriding are part of the interface of a class,
>> albeit an interface that only a subset of other classes will use.
>> Think carefully about why, if this is meant to be made available, it
>> isn't simply a method call.
>
> Properties are also part of the class interface. I don't see any good
> reason why property get and set methods should not be overridden in
> subclasses.

Right, I'm not saying they aren't; I'm just saying that properties are
intended for simpler purposes than you'll normally need subclassing
for.

I'll wait for your follow-up email with a use case.

ChrisA



More information about the Python-list mailing list