Tkinter callback arguments

Alf P. Steinbach alfps at start.no
Wed Nov 4 20:48:00 EST 2009


* Steven D'Aprano:
> On Wed, 04 Nov 2009 08:50:42 +0100, Alf P. Steinbach wrote:
> 
>> * Gabriel Genellina:
>>> I don't understand either. R1 and R2 have *different* semantics.
>> Assume that they have the very exact same semantics  
> 
> 
> Why would we assume that when you have explicitly told us that they don't?
> 
> You stated categorically that they behave differently when you assign to 
> the attribute/property "top".

Uh, severe reading difficulties ... referring to self in plural ... Hm. :-)

But anyway, in the example description I wrote

   "With R1 direct changes of left and top keeps the rectangle's size"

and this is in the context of a discussion of modifying data attributes directly 
versus using properties.

Anyway, if that formulation was confusing I have clarified it later, so you 
really, ideally, should have no problem grasping this.


> According to your own description, setting 
> R1.top moves the rectangle, while setting R2.top resizes it. Perhaps the 
> difference between "move" and "resize" is too subtle for you, but you can 
> trust us on this, they are different semantics.

No, I would absolutely not trust you Steven, whether that's plural or singular, 
to assign semantics to my examples.


>> --  like two TV
>> sets that look the same and work the same except when you open 'em up
>> and poke around in there, oh holy cow, in this one there's stuff that
>> isn't in the other.
> 
> 
> Whether "top" is an attribute or a property is irrelevant,

Sorry, that's incorrect.

For example, if it is a read only property than you can't assign to the property.

For another example, if it is a read/write property than it can update any parts 
of the rectangle represention.


> it is still 
> part of the public API of the class.

Sorry, that's incorrect; it depends on the class.


> Such public attributes are NOT 
> private internal details, they are part of the public interface.

Sorry, that's incorrect; it depends on the class, and as far as I know and have 
been informed here there are no private attributes in Python, just a notational 
convention.


> You've 
> been told this repeatedly.

Sorry, but repeating what you want me to have meant in my example, contrary to 
the direct text of the example, contrary to its context, choosing a meaningless 
interpreteration of what's left when you have ignored the text, plus contrary to 
further clarifications, well that's daft to say the least.


> Perhaps one more time may help:
> 
> Public attributes are public.

It would be nice if Python had private ones, yes.


Cheers & hth.,

- Alf



More information about the Python-list mailing list