Changes between and of Initial VersionVersion 1Ticket #5689


Ignore:
Timestamp:
05/28/2012 09:53:16 AM (6 years ago)
Author:
therve
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #5689 – Description

    initial v1  
    1 The "classical" division operator "/" has been deprecated for a long while (Python 2.2 I believe) as it is ambiguous - it means floor division with ints, but true division otherwise. In Python 3, the "/" operator is for true division (always returns a float), while the unambiguous operator "//" should be used for floor division. As such, it is required to explicitly either import division from __future__ or use the floor division operator.
     1The "classical" division operator "/" has been deprecated for a long while (Python 2.2 I believe) as it is ambiguous - it means floor division with ints, but true division otherwise. In Python 3, the "/" operator is for true division (always returns a float), while the unambiguous operator "//" should be used for floor division. As such, it is required to explicitly either import division from `__future__` or use the floor division operator.
    22
    3 Most of the time, division was used to force a ZeroDivisionError, for testing purposes. In such cases I've usually imported from __future__, though in some cases I just changed the line to use the floor operator (as the effect is the same). The only places where floor division actually needed to be used are:
     3Most of the time, division was used to force a ZeroDivisionError, for testing purposes. In such cases I've usually imported from `__future__`, though in some cases I just changed the line to use the floor operator (as the effect is the same). The only places where floor division actually needed to be used are:
    44
    55 * twisted/conch/connection.py