Tkinter callback arguments
Mel
mwilson at the-wire.com
Mon Nov 2 11:19:51 EST 2009
Alf P. Steinbach wrote:
> Your comment about "computed" makes it more clear what that's all about.
> Also Bertrand Meyer (Eiffel language creator) had idea like that, he
> called it "referential transparency". But I think when Python has this
> nice property mechanism, why do people change direct data attributes into
> properties and not the other way around or not at all,
Python tends to prefer simple forms over complicated forms, so having a
programmer write
x = something.that
and implementing a getter inside the call to something.__getattr__ is better
than
x = something.that()
with a pair of needless parens, and then mangling the compiler/runtime to
suddenly use the value of `that`, uncalled, if `something` happens to be an
instance of the class we're discussing.
Note too that
something.that = x
is pretty clean, but
something.that() = x
can't be done at all, and the syntactically correct
something.that(x)
just doesn't look like the simple assignment statement.
Mel.
More information about the Python-list
mailing list