Hello,

I am thinking about wether I should use python properties in my code. As PyQt is currently following Qt style (getter: property(), setter: getProperty()), I am a bit undecided.

Benefits of python properties from my point of view:

1. Code is more expressive (readability).

Drawbacks:

1. Classes derived from Qt classes mix python and Qt property style (inconsistent).
                
2. One more design decision to worry about: Is this a methos or is it a (readonly) property? You also have to remember this in the client code.

3. Python properties do not natively support getter/setter overriding in subclasses. (I know there are ways around this, but I'd rather stick with what standard python provides.)

4. Bloats class definition (extra line for property()).

What do you think?

Regards
Georg

_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to