2 ms·
It would do so if one of the numbers was a float - 1.0/2.0 gave a float answer, 1/2 gave an integer answer. It was also possible in recent Python versions to s
by jodrellblank 17y ago
It would do so if one of the numbers was a float - 1.0/2.0 gave a float answer, 1/2 gave an integer answer.
It was also possible in recent Python versions to switch this behaviour using "from __future__ import division" so they recognised it as a ward, but it's only with the decision to allow Python 3 to make backwards compatibility breaking changes that it could be changed normally.
- masklinn 17y ago> It was also possible in recent Python versions Not that recent, the switch has been there since 2.2 alpha 2, released 8 years ago (August 22, 2001): __all__ = ['all_feature_names', 'nested_scopes', 'generators', 'divisi... absolute_import = _Feature((2, 5, 0, 'alpha', 1), (2, 7, 0, 'alpha', 0... all_feature_names = ['nested_scopes', 'generators', 'division', 'absol... division = _Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192... generators = _Feature((2, 2, 0, 'alpha', 1), (2, 3, 0, 'final', 0), 0) nested_scopes = _Feature((2, 1, 0, 'beta', 1), (2, 2, 0, 'alpha', 0), ... print_function = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0)... unicode_literals = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', ... with_statement = _Feature((2, 5, 0, 'alpha', 1), (2, 6, 0, 'alpha', 0)...
- mcav 17y agoEverything's relative. XP was just released in 2001... that was ages ago. Relatively.