Mark Dickinson <dicki...@gmail.com> added the comment:

Agreed that "of the same type" part is confusing. I suspect the intended 
meaning was that the operation *expects* both arguments to have the same type, 
so if the actual arguments have different types then they have to be coerced to 
a common type. In the example you mention, the 3 is converted to 3.0 so that 
the actual addition is applied to two arguments of the same type. So I think 
the "same type" part *was* intentional, if confusing.

But coercion was more of a real thing in Python 2, where there was a __coerce__ 
special method and a coerce builtin function. It isn't really a thing any more 
in Python 3, except inasmuch as it means "implicit type conversion". And I 
can't find any uses of :term:`coercion` elsewhere in the docs. Maybe we should 
just delete this glossary entry?

If all we mean by coercion is implicit type conversion, then the "operation 
which involves two arguments" part already seems over-specific: math.sqrt 
implicitly converts its argument to a float, for example.

----------

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

Reply via email to