mirror of
https://github.com/python/cpython.git
synced 2026-02-05 09:25:35 +00:00
#3734: document complex coercing behavior better.
This commit is contained in:
parent
8fba5b337c
commit
9834dd72bc
1 changed files with 2 additions and 1 deletions
|
|
@ -2252,7 +2252,8 @@ will not be supported.
|
|||
|
||||
In the current implementation, the built-in numeric types :class:`int`,
|
||||
:class:`long` and :class:`float` do not use coercion; the type :class:`complex`
|
||||
however does use it. The difference can become apparent when subclassing these
|
||||
however does use coercion for binary operators and rich comparisons, despite
|
||||
the above rules. The difference can become apparent when subclassing these
|
||||
types. Over time, the type :class:`complex` may be fixed to avoid coercion.
|
||||
All these types implement a :meth:`__coerce__` method, for use by the built-in
|
||||
:func:`coerce` function.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue