Python 3 – there shall be just int

Trying to contribute to the Flask plugin flask-login I just added these lines: if isinstance(duration, (int, long)): duration = timedelta(seconds=duration) Looking quite plausible, isn’t it? But lo and behold: it doesn’t work under Python 3.x. Dang! The reason: Python 2 has two integer types: int and long. In Python 3 there is only int, which…