]> granicus.if.org Git - python/commitdiff
Fix the clarification as to why division cannot be ported automatically
authorBrett Cannon <brett@python.org>
Fri, 27 Feb 2015 20:10:03 +0000 (15:10 -0500)
committerBrett Cannon <brett@python.org>
Fri, 27 Feb 2015 20:10:03 +0000 (15:10 -0500)
Doc/howto/pyporting.rst

index bd80dfd7cf1fb9ca59b2ad2bdefef197829a0286..d2cd9dee5f92d81297d1c87d92ef519f7f763fca 100644 (file)
@@ -169,8 +169,9 @@ things:
    division or continue using ``/`` and expect a float
 
 The reason that ``/`` isn't simply translated to ``//`` automatically is that if
-an object defines its own ``__div__`` method but not ``__floordiv__`` then your
-code would begin to fail.
+an object defines a ``__truediv__`` method but not ``__floordiv__`` then your
+code would begin to fail (e.g. a user-defined class that uses ``/`` to
+signify some operation but not ``//`` for the same thing or at all).
 
 Text versus binary data
 +++++++++++++++++++++++