[wx-dev] Odd comparison results with wx.Point objects

Robin Dunn robin at alldunn.com
Mon May 7 13:55:32 PDT 2007


Jussi Salmela wrote:

> of page 43 says:
>     In addition, wx.Point instances can be transparently added, subtracted,
>     and compared just like other Python objects. For example:"
> and goes on to give the example at the start of page 44:
>     x = wx.Point(2, 3)
>     y = wx.Point(5, 7)
>     z = x + y
>     bigger = x > y
> doing the greater-than comparison and giving the result a specific name, 
> I got
> the impression that it could be useful since the books on various 
> subjects I've
> read before do not represent useless ways of doing things.

The person who wrote the chapter probably didn't look at the code, but 
just tried out the statement.  If the id()'s happened to align correctly 
then the statement would appear to succeed.

-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wx-dev mailing list