Re: sys.maxint in Python 3

2008-04-21 Thread castironpi
On Apr 21, 5:20 pm, Paul Rubin wrote: > [EMAIL PROTECTED] writes: > > In some algorithms a sentinel value may be useful, so for Python 3.x > > Better to just use object() to generate sentinels. Infinity is a number that compares always like. -- http://mail.python.org/mai

Re: sys.maxint in Python 3

2008-04-21 Thread Paul Rubin
[EMAIL PROTECTED] writes: > In some algorithms a sentinel value may be useful, so for Python 3.x Better to just use object() to generate sentinels. -- http://mail.python.org/mailman/listinfo/python-list

Re: sys.maxint in Python 3

2008-04-21 Thread Christian Heimes
[EMAIL PROTECTED] schrieb: > In some algorithms a sentinel value may be useful, so for Python 3.x > sys.maxint may be replaced by an improvement of the following infinite > and neginfinite singleton objects: Python 3.0 doesn't have sys.maxint any more since Python 3's ints are of arbitrary length.

sys.maxint in Python 3

2008-04-21 Thread bearophileHUGS
In some algorithms a sentinel value may be useful, so for Python 3.x sys.maxint may be replaced by an improvement of the following infinite and neginfinite singleton objects: class Infinite(object): def __repr__(self): return "infinite" def __cmp__(self, other): if other is infinit