Steven D'Aprano <steve+pyt...@pearwood.info> added the comment:

> the result is different from other languages which is why it can be 
> surprising.

Maybe the other languages should be documenting their surprising result, which 
fails to preserve the identity?

> Do we - add a warning to the [tutorial] page, or should we link to a new page 
> that details and explains the behavior.

Neither. Warnings are for *dangerous or risky behaviour*, this is neither. And 
we surely don't need an entire new page just to document a minor piece of 
arithmetic behaviour.

The behaviour (although not the rationale for it) is already documented here:

https://docs.python.org/3/reference/expressions.html#binary-arithmetic-operations

although not here:

https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex

You could add a note to the table at the second link, and a FAQ next to this:

https://docs.python.org/3/faq/programming.html#why-does-22-10-return-3

----------
nosy: +steven.daprano

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43737>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to