Python 3 has float(\'inf\')
and Decimal(\'Infinity\')
but no int(\'inf\')
. So, why a number representing the infinite set of integers is m
For python 2. It is sometimes the case that you need a very large integer. For example, I may want to produce a subarray with x[:n] and, I may wish to sometimes set n to a value such that the whole array will be produced. Since you can't use a float for n (python wants an integer), you need a "large integer". A good way of doing this is to use the largest integer available: sys.maxint. Here is an example:
# MAX_SOURCES = sys.maxint # normal setting
MAX_SOURCES = 5 # while testing
# code to use an array ...
... sources[:MAX_SOURCES]
So, while testing, I could use a smaller sources array but use the full array in production.