Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Tkinter callback arguments
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 26 - 34 of 34 - Collapse all  -  Translate all to Translated (View all originals) < Older 
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Gabriel Genellina  
View profile  
 More options Nov 4, 8:38 pm
Newsgroups: comp.lang.python
From: "Gabriel Genellina" <gagsl-...@yahoo.com.ar>
Date: Wed, 04 Nov 2009 06:38:50 -0300
Local: Wed, Nov 4 2009 8:38 pm
Subject: Re: Tkinter callback arguments
En Wed, 04 Nov 2009 04:50:42 -0300, Alf P. Steinbach <al...@start.no>  
escribió:

> * Gabriel Genellina:
>>  I don't understand either. R1 and R2 have *different* semantics.

> Assume that they have the very exact same semantics  --  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.

>> They don't behave the same.

> Assume that they do  --  except when you go poking into the innards.

And the problem is...?
That the internal details are different? Who cares?
(I'm lost now.)

--
Gabriel Genellina


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alf P. Steinbach  
View profile  
 More options Nov 4, 8:45 pm
Newsgroups: comp.lang.python
From: "Alf P. Steinbach" <al...@start.no>
Date: Wed, 04 Nov 2009 10:45:51 +0100
Local: Wed, Nov 4 2009 8:45 pm
Subject: Re: Tkinter callback arguments
* Gabriel Genellina:

It's a common Usenet phenomenon: the warping thread.

Context is lost.

It is available by going back up-thread but at the cost of some work. :-)

Cheers & hth.,

- Alf


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Terry Reedy  
View profile  
 More options Nov 5, 5:46 am
Newsgroups: comp.lang.python
From: Terry Reedy <tjre...@udel.edu>
Date: Wed, 04 Nov 2009 13:46:39 -0500
Local: Thurs, Nov 5 2009 5:46 am
Subject: Re: Tkinter callback arguments

Alf P. Steinbach wrote:
> However, the natural semantics is that various logical properties, such
> as left, top, right, bottom, width and height, can be varied independently.

But they *CANNOT* be varied independently. A rectangle with side
parallel to the axes has exactly 4 degress of freedom, not 6.

Terry Jan Reedy


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alf P. Steinbach  
View profile  
 More options Nov 5, 8:08 am
Newsgroups: comp.lang.python
From: "Alf P. Steinbach" <al...@start.no>
Date: Wed, 04 Nov 2009 22:08:49 +0100
Local: Thurs, Nov 5 2009 8:08 am
Subject: Re: Tkinter callback arguments
* Terry Reedy:

> Alf P. Steinbach wrote:

>> However, the natural semantics is that various logical properties,
>> such as left, top, right, bottom, width and height, can be varied
>> independently.

> But they *CANNOT* be varied independently. A rectangle with side
> parallel to the axes has exactly 4 degress of freedom, not 6.

Yes <g>. That's the basic idea of the example I presented up-thread, that's
discussed here. With R1's state variables width and heigh can be varied
independently by direct modification, with R2 it's right and bottom.

The public interface must also make this choice, but it's an independent choice:
the internal rectangle representation can have the opposite choice.

And conversely, that means that if the internal representation isn't used
directly, then it can be changed without affecting the public interface.

Cheers,

- Alf


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Steven D'Aprano  
View profile  
 More options Nov 5, 11:39 am
Newsgroups: comp.lang.python
From: Steven D'Aprano <ste...@REMOVE.THIS.cybersource.com.au>
Date: 05 Nov 2009 00:39:25 GMT
Local: Thurs, Nov 5 2009 11:39 am
Subject: Re: Tkinter callback arguments

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". 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.

> --  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, it is still
part of the public API of the class. Such public attributes are NOT
private internal details, they are part of the public interface. You've
been told this repeatedly. Perhaps one more time may help:

Public attributes are public.

--
Steven


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alf P. Steinbach  
View profile  
 More options Nov 5, 12:48 pm
Newsgroups: comp.lang.python
From: "Alf P. Steinbach" <al...@start.no>
Date: Thu, 05 Nov 2009 02:48:00 +0100
Subject: Re: Tkinter callback arguments
* 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


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alf P. Steinbach  
View profile  
 More options Nov 5, 1:55 pm
Newsgroups: comp.lang.python
From: "Alf P. Steinbach" <al...@start.no>
Date: Thu, 05 Nov 2009 03:55:53 +0100
Local: Thurs, Nov 5 2009 1:55 pm
Subject: Re: Tkinter callback arguments
* Alf P. Steinbach:

Perhaps this makes it more clear: in R1, which has a width/height based
rectangle representation, assigning directly to the top data attribute
/effectively/ moves the rectangle vertically without changing its height, since
the height attribute is unchanged.

But that does not reflect any intended semantics, it's not a requirement; it's
an implementation artifact, a behavior that just results from direct
modification and the choice of a particular rectangle representation.

Real world Python example of that kind of artifact: as discussed in some other
thread here, doing open( ..., 'r+' ) followed by write followed directly by read
will on some implementations/systems produce garbage. Presumably because those
implementations use C "FILE*" to implement the functionality, and implements it
by a fairly direct mapping of calls down to the C level, where this sequence is
in general Undefined Behavior. You might regard it as semantics, and it's quite
real and presumably in a sense well-defined for the particular implementation on
the particular system, but it's not part of any intended semantics, and any who
relies on that behavior is doing it at other's risk.

For the R1 class the indended semantics, the specification that the programmer
was handed down or produced or had in mind, might include just rectangle
construction, checking intersection with other rectangle, and obtaining any of
three pairs of values: left upper corner, right lower corner and width+height.

For example. :-)

Cheers & hth.,

- Alf


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gabriel Genellina  
View profile  
 More options Nov 5, 6:34 pm
Newsgroups: comp.lang.python
From: "Gabriel Genellina" <gagsl-...@yahoo.com.ar>
Date: Thu, 05 Nov 2009 04:34:16 -0300
Local: Thurs, Nov 5 2009 6:34 pm
Subject: Re: Tkinter callback arguments
En Wed, 04 Nov 2009 18:08:49 -0300, Alf P. Steinbach <al...@start.no>  
escribió:

And that's exactly what everyone is saying - so we all agree then!

--
Gabriel Genellina


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alf P. Steinbach  
View profile  
 More options Nov 5, 8:04 pm
Newsgroups: comp.lang.python
From: "Alf P. Steinbach" <al...@start.no>
Date: Thu, 05 Nov 2009 10:04:15 +0100
Local: Thurs, Nov 5 2009 8:04 pm
Subject: Re: Tkinter callback arguments
* Gabriel Genellina:

Well, it may be that we *violently* agree. :-)

Cheers,

- Alf


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages < Older 
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google