This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients StevenHsuYL, docs@python, mark.dickinson
Date 2021-07-16.18:28:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1626460099.2.0.735302572717.issue44651@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2021-07-16 18:28:19mark.dickinsonsetrecipients: + mark.dickinson, docs@python, StevenHsuYL
2021-07-16 18:28:19mark.dickinsonsetmessageid: <1626460099.2.0.735302572717.issue44651@roundup.psfhosted.org>
2021-07-16 18:28:19mark.dickinsonlinkissue44651 messages
2021-07-16 18:28:17mark.dickinsoncreate