
APPENDIX A ■ PORTING CODE TO PYTHON 3 WITH 2TO3
319
1. maxint becomes maxsize.
2. Any usage of sys.maxint becomes sys.maxsize.
callable() Global Function
In Python 2, you could check whether an object was callable (like a function) with the global callable()
function. In Python 3, this global function has been eliminated. To check whether an object is callable,
check for the existence of the __call__() special method. (See Table A-36.)
Table A-36. The callable() Global Function
Python 2 Python 3
callable(anything) hasattr(anything, '__call__')
zip() Global Function
In Python 2, the global zip() function took any number of sequences and ...