-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
Doc: int -> int or Py_ssize_t #18663
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks @methane for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8. |
GH-18665 is a backport of this pull request to the 3.8 branch. |
GH-18666 is a backport of this pull request to the 3.7 branch. |
(cherry picked from commit 57c7a0b) Co-authored-by: Inada Naoki <[email protected]>
(cherry picked from commit 57c7a0b) Co-authored-by: Inada Naoki <[email protected]>
(cherry picked from commit 57c7a0b) Co-authored-by: Inada Naoki <[email protected]>
I'm not sure if this change is correct: the function uses int or Py_ssize_t depending on Are you suggesting to stop supporting C extension which don't use PY_SSIZE_T_CLEAN? See the note:
|
As far as I know, it is correct. All
Yes. We raise DeprecationWarning when (cc @serhiy-storchaka ) |
It is definitely an improvement. Maybe we could add a footnote in all these sites to clarify that the type is As for removing |
Python 3.8 implements the runtime warning. Python 3.9 will be the second version of runtime warning. Static checker will be better, but I don't know how we can achieve it. |
Sorry, I thought it is a 3.9 feature. In any case 3.10 is too earlier for breaking C API change. Especially with reducing the time between releases. Maybe PyCharm or VS Code will start to complain about PyArg_Parse() without PY_SSIZE_T_CLEAN and provide refactoring tools to insert PY_SSIZE_T_CLEAN and convert size types automatically. |
In that case, IMO it's fine to start to raise an error in Python 3.10: we would have two releases (3.8 and 3.9) with the deprecation warning. |
No description provided.