[Python] property polimorfica
Simone Federici
s.federici a gmail.com
Mer 4 Giu 2014 07:58:55 CEST
The advantage of properties is that they are syntactically identical to
attribute access, so you can change from one to another without any changes
to client code. You could even have one version of a class that uses
properties (say, for code-by-contract or debugging) and one that doesn't
for production, without changing the code that uses it. At the same time,
you don't have to write getters and setters for everything just in case you
might need to better control access later.
from kindall:
http://stackoverflow.com/a/6618176
la soluzione x me è valida, perche Dad introducendo la property fa
l'override dell'attributo value.
--
Simone Federici
------------------------
Software Craftsman
XP, Agile, Scrum, Kanban
Quality, performance & security
Explicit is better than implicit.
-------------- parte successiva --------------
Un allegato HTML è stato rimosso...
URL: <http://lists.python.it/pipermail/python/attachments/20140604/11ef55f9/attachment.html>
Maggiori informazioni sulla lista
Python