From: Brett Cannon Date: Fri, 27 Feb 2015 20:10:03 +0000 (-0500) Subject: Fix the clarification as to why division cannot be ported automatically X-Git-Tag: v3.5.0a2~73^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fdde79dbf6ae6d1d3b15770a2e87a5108197d826;p=python Fix the clarification as to why division cannot be ported automatically --- diff --git a/Doc/howto/pyporting.rst b/Doc/howto/pyporting.rst index bd80dfd7cf..d2cd9dee5f 100644 --- a/Doc/howto/pyporting.rst +++ b/Doc/howto/pyporting.rst @@ -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 +++++++++++++++++++++++