-5

In an algorithms course we're using python 2.7 because we "hand in" our code on the course website and automatically test it with different input, and I suppose it's a compatibility issue.

The current assignment is a all-to-all shortest path problem, and we're given a framework for our code in which they import maxint. Just wondering what maxint does.

Auclair
  • 125
  • 1
  • 10

1 Answers1

0

Python Standard Types. An excerpt below, emphasis mine.

There are four distinct numeric types: plain integers, long integers, floating point numbers, and complex numbers. In addition, Booleans are a subtype of plain integers. Plain integers (also just called integers) are implemented using long in C, which gives them at least 32 bits of precision (sys.maxint is always set to the maximum plain integer value for the current platform, the minimum value is -sys.maxint - 1).

The only reason I can think of for them to be importing it, is for bounds checking reasons.

Christian Witts
  • 11,375
  • 1
  • 33
  • 46