Does Python really follow its philosophy of "Readability counts"?
bdesth.quelquechose at free.quelquepart.fr
Thu Jan 15 20:54:49 CET 2009
Paul Rubin a écrit :
> Bruno Desthuilliers <bdesth.quelquechose at free.quelquepart.fr> writes:
>>> We're not talking about libraries here.
>> Yes we are. If the default is "non-dynamic", then a class author is in
>> charge of explicitely allowing it when *he* see fits.
> Oh, I see what you mean, the standard libraries would be affected if
> the language default were to tone down the dynamism. True.
Not only the standard lib. Quite a lot of frameworks relies on these
>> As long as it's up to the *user* to choose, that's ok. Your "@dynamic"
>> class decorator doesn't have the same implications.
> Well, you could use it on library classes too:
> from library import Libclass
> Libclass = dynamic(Libclass)
That's fine when you directly use the class. Not when you work with
instances provided by a framework (or another lib) that won't be
affected by your above rebinding.
More information about the Python-list