Skip to content

Conversation

@ZackerySpytz
Copy link
Contributor

@ZackerySpytz ZackerySpytz commented Jan 31, 2022

Calling int(a) when type(a) implements __trunc__ but not __int__ or __index__ now raises a DeprecationWarning.

https://bugs.python.org/issue44977

Calling int(a) when type(a) implements __trunc__ but not __int__
or __index__ now raises a DeprecationWarning.
Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

as deprecated, its docstring is now corrected).
(Contributed by Hugo van Kemenade in :issue:`45837`.)

* The delegation of :func:`int` to :meth:`__trunc__` is now deprecated. Calling
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* The delegation of :func:`int` to :meth:`__trunc__` is now deprecated. Calling
* The delegation of :class:`int` to :meth:`__trunc__` is now deprecated. Calling

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

int() is referred as a function here, not a class.

The current text is correct.

@@ -0,0 +1,3 @@
The delegation of :func:`int` to :meth:`__trunc__` is now deprecated.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The delegation of :func:`int` to :meth:`__trunc__` is now deprecated.
The delegation of :class:`int` to :meth:`__trunc__` is now deprecated.

@serhiy-storchaka serhiy-storchaka merged commit b4bd1e1 into python:main Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants