mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-09 05:20:08 +01:00
AGW on Phoenix: add __lt__ and __gt__ methods to the FixedPoint class in FloatSpin, as Python 3 is funnier than I thought.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73586 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -120,7 +120,7 @@ andrea.gavana@maerskoil.com
|
||||
|
||||
AGW version: 0.9.7
|
||||
|
||||
Last updated: 18 February 2013, 21.00 GMT
|
||||
Last updated: 28 February 2013, 21.00 GMT
|
||||
|
||||
"""
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# Python Code By:
|
||||
#
|
||||
# Andrea Gavana, @ 16 Nov 2005
|
||||
# Latest Revision: 27 Dec 2012, 21.00 GMT
|
||||
# Latest Revision: 28 Feb 2013, 21.00 GMT
|
||||
#
|
||||
#
|
||||
# TODO List/Caveats
|
||||
@@ -136,7 +136,7 @@ License And Version
|
||||
|
||||
:class:`FloatSpin` control is distributed under the wxPython license.
|
||||
|
||||
Latest revision: Andrea Gavana @ 27 Dec 2012, 21.00 GMT
|
||||
Latest revision: Andrea Gavana @ 28 Feb 2013, 21.00 GMT
|
||||
|
||||
Version 1.0
|
||||
|
||||
@@ -1584,6 +1584,18 @@ class FixedPoint(object):
|
||||
def __int__(self):
|
||||
return int(self.__long__())
|
||||
|
||||
def __lt__(self, other):
|
||||
if other is None:
|
||||
return 1
|
||||
xn, yn, p = _norm(self, other)
|
||||
return xn < yn
|
||||
|
||||
def __gt__(self, other):
|
||||
if other is None:
|
||||
return 1
|
||||
xn, yn, p = _norm(self, other)
|
||||
return xn > yn
|
||||
|
||||
def frac(self):
|
||||
"""
|
||||
Returns fractional portion as a :class:`FixedPoint`.
|
||||
|
||||
Reference in New Issue
Block a user