Skip to content

Conversation

@skirpichev
Copy link
Contributor

@skirpichev skirpichev commented Dec 4, 2023

@skirpichev
Copy link
Contributor Author

CC @vstinner maybe it's time, after 6 releases?

@vstinner
Copy link
Member

I would prefer to wait for Python 3.15 alpha 1. IMO changing the behavior in Python 3.14 beta 1 is too late.

@skirpichev
Copy link
Contributor Author

CC @vstinner
CC @picnixz

Copy link
Member

@picnixz picnixz left a comment

Choose a reason for hiding this comment

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

Please update:

  • Doc/whatsnew/3.15.rst: the C API removal section
  • Maybe a versionchanged entry under object.__complex__ and object.__float__.
  • In a follow-up PR, let's also update "c-api-pending-removal-in-315" to notify this change in 3.13 & 3.14 (still, make a PR against main)

@picnixz
Copy link
Member

picnixz commented May 11, 2025

I think you need to regenerate the NEWS entry as it's in an "old" folder

@skirpichev
Copy link
Contributor Author

Doc/whatsnew/3.15.rst: the C API removal section

Are you sure it should be here? Strictly speaking, this affects not just C extensions.

So far, this placed in "Others" subsection of "Removed" section.

Maybe a versionchanged entry under object.complex and object.float.

Docs already says: Should return a value of the appropriate type.

I think you need to regenerate the NEWS entry as it's in an "old" folder

In most (all?) cases you could just move news entry.

@picnixz
Copy link
Member

picnixz commented May 11, 2025

Are you sure it should be here? Strictly speaking, this affects not just C extensions.

Ah yes, my bad. Make it under the builtins module then maybe or "Others" as you suggested, up to you

Docs already says: Should return a value of the appropriate type.

Oh ok. No need for an additional note then.

@skirpichev skirpichev requested a review from picnixz May 11, 2025 11:29
Copy link
Member

@picnixz picnixz left a comment

Choose a reason for hiding this comment

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

The "pending-future-removal" document would still contain the deprecation notice so let's move it to 3.15.rst in a follow-up PR (or in this one, up to you). Since it's in "future removal", I don't know if we actually need a second round of discussion to decide on the version.

In the docs it says "should return", maybe we should be more precise and make it a "must return a float/complex". While users would see a DeprecationWarning, it's better for new online docs to state that we only want exact float/complex.

@skirpichev skirpichev requested a review from picnixz May 11, 2025 13:39
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM. I would like to hear @serhiy-storchaka on this issue, he wrote similar changes for other types.

@serhiy-storchaka
Copy link
Member

I have a completely opposite opinion. I will try to start a new discussion soon.

@vstinner
Copy link
Member

I have a completely opposite opinion. I will try to start a new discussion soon.

Any update @serhiy-storchaka?

Copy link
Member

@picnixz picnixz left a comment

Choose a reason for hiding this comment

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

I'm ok with this change but I'd like to hear about Serhiy's objections.

@vstinner
Copy link
Member

vstinner commented Jun 2, 2025

@skirpichev
Copy link
Contributor Author

@vstinner, what do you think on Serhiy's arguments?

I don't see too much feedback from the discussion so far. What should we do? I linked some old related discussion in comment.

@skirpichev skirpichev requested a review from AA-Turner as a code owner October 10, 2025 04:56
@skirpichev
Copy link
Contributor Author

@picnixz, what do you think on Serhiy's opinion?

@vstinner
Copy link
Member

@vstinner, what do you think on Serhiy's arguments?

I replied on Discourse: https://discuss.python.org/t/about-type-conversion-special-methods/94212/8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants