FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Replace PyObject_Del with PyObject_Free by vstinner · Pull Request #122453 · python/cpython · GitHub

Repository navigation

Replace PyObject_Del with PyObject_Free - #122453

Merged
vstinner merged 1 commit into
python:mainfrom
vstinner:pyobject_free
Aug 1, 2024
Merged

vstinner merged 1 commit into
python:mainfrom
vstinner:pyobject_free

Conversation

vstinner commented Jul 30, 2024 •
edited by github-actions Bot
Loading

Copy link
Copy Markdown
Member

PyObject_Del() is just a alias to PyObject_Free() kept for backward compatibility. Use directly PyObject_Free() instead.


📚 Documentation preview 📚: https://cpython-previews--122453.org.readthedocs.build/

PyObject_Del() is just a alias to PyObject_Free() kept for backward
compatibility. Use directly PyObject_Free() instead.
vstinner merged commit fda6bd8 into python:main Aug 1, 2024
vstinner deleted the pyobject_free branch August 1, 2024 12:12

lazka commented Aug 1, 2024 •
edited
Loading

Copy link
Copy Markdown
Contributor

This is an improvement, but now the docs are inconsistent/contradicting:

  • tp_dealloc docs say that PyObject_Free() should be used after PyObject_New() for example. PyObject_Free() docs states that this is undefined behavior.
  • PyObject_Del() docs say that is should be called from tp_dealloc, while tp_dealloc docs say PyObject_Free() should be called.

vstinner commented Aug 2, 2024

Copy link
Copy Markdown
Member Author

I wrote a follow-up PR to update the doc: #122597

blhsing pushed a commit to blhsing/cpython that referenced this pull request Aug 22, 2024
PyObject_Del() is just a alias to PyObject_Free() kept for backward
compatibility. Use directly PyObject_Free() instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

2 participants


Back | FazBrowse Home | New Git URL