Doc: int -> int or Py_ssize_t#18663
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 <songofacandy@gmail.com>
(cherry picked from commit 57c7a0b) Co-authored-by: Inada Naoki <songofacandy@gmail.com>
(cherry picked from commit 57c7a0b) Co-authored-by: Inada Naoki <songofacandy@gmail.com>
|
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.