Module interval :: Class Largest
[show private | hide private]
[frames | no frames]

Class Largest


Class representing the universal largest value

This type doesn't do much; it implements a pseudo-value that's larger than everything but itself.
>>> infinity = Largest()
>>> greatest = Largest()
>>> 6234 < infinity
True

>>> 6234 == infinity
False

>>> 6234 > infinity
False

>>> infinity > infinity
False

>>> infinity == greatest
True

Method Summary
  __cmp__(self, other)
Compares object with another object
  __hash__(self)
Returns a value that can be used for generating hashes
  __neg__(self)
Returns the smallest universal value
  __repr__(self)
Returns an evaluable expression representing this object
  __str__(self)
Returns a string representation of the object

Method Details

__cmp__(self, other)
(Comparison operator)

Compares object with another object

Always indicates that self is greater than other, unless both are of type Largest, in which case they are equal.
>>> 0 > Largest()
False

>>> Largest() < 9999999
False

>>> Largest() > 9999999
True

>>> Largest() < Largest()
False

>>> Largest() == Largest()
True

__hash__(self)
(Hashing function)

Returns a value that can be used for generating hashes

__neg__(self)

Returns the smallest universal value

The opposite of infinity is negative infinity, the smallest value.
>>> print -Largest()
-~

__repr__(self)
(Representation operator)

Returns an evaluable expression representing this object
>>> Largest()
Inf

__str__(self)
(Informal representation operator)

Returns a string representation of the object

The largest number is displayed as ~ (it sort of looks like infinity...)
>>> print Largest()
~

Generated by Epydoc 2.1 on Wed Nov 9 22:22:38 2005 http://epydoc.sf.net