| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
- Add alignment requirement - Mention that ob_size is unreliable if you don't control it - Add some links for context - basicsize should include the base type in generaly not just PyObject This adds a “by-the-way” link to `PyObject_New`, which shouldn't be used for GC types. In order to be comfortable linking to it, I also add a link to `PyObject_GC_New` from its docs. And the same for `*Var` variants, while I'm here.
| exceptions: for example, ints use a negative :c:member:`~PyVarObject.ob_size` to indicate a | ||
| negative number, and N is ``abs(ob_size)`` there. Also, the presence of an |
There was a problem hiding this comment.
@markshannon FWIW, here's another piece of documentation that says abs(ob_size) gives you the size of a PyLongObject.
Sorry, something went wrong.
There was a problem hiding this comment.
Mostly LGTM. Feel free to ignore any of my comments, these are pretty much just what I thought to myself as I read through it.
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks for the review!
Things can always be improved, but it looks like this iteration is good to go.
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks, LGTM :)
Sorry, something went wrong.
|
Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Sorry, something went wrong.
|
Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Sorry, something went wrong.
…ythonGH-129850) * Update documentation for tp_basicsize & tp_itemsize - Add alignment requirement - Mention that ob_size is unreliable if you don't control it - Add some links for context - basicsize should include the base type in generaly not just PyObject This adds a “by-the-way” link to `PyObject_New`, which shouldn't be used for GC types. In order to be comfortable linking to it, I also add a link to `PyObject_GC_New` from its docs. And the same for `*Var` variants, while I'm here. * Strongly suggest Py_SIZE & Py_SET_SIZE (cherry picked from commit ad0f618) Co-authored-by: Petr Viktorin <encukou@gmail.com>
|
GH-131078 is a backport of this pull request to the 3.12 branch. |
Sorry, something went wrong.
…ythonGH-129850) * Update documentation for tp_basicsize & tp_itemsize - Add alignment requirement - Mention that ob_size is unreliable if you don't control it - Add some links for context - basicsize should include the base type in generaly not just PyObject This adds a “by-the-way” link to `PyObject_New`, which shouldn't be used for GC types. In order to be comfortable linking to it, I also add a link to `PyObject_GC_New` from its docs. And the same for `*Var` variants, while I'm here. * Strongly suggest Py_SIZE & Py_SET_SIZE (cherry picked from commit ad0f618) Co-authored-by: Petr Viktorin <encukou@gmail.com>
|
GH-131079 is a backport of this pull request to the 3.13 branch. |
Sorry, something went wrong.
…GH-129850) (GH-131078) - Add alignment requirement - Mention that ob_size is unreliable if you don't control it - Add some links for context - basicsize should include the base type in generaly not just PyObject - suggest Py_SIZE & Py_SET_SIZE This adds a “by-the-way” link to `PyObject_New`, which shouldn't be used for GC types. In order to be comfortable linking to it, I also add a link to `PyObject_GC_New` from its docs. And the same for `*Var` variants, while I'm here. (cherry picked from commit ad0f618) Co-authored-by: Petr Viktorin <encukou@gmail.com>
…GH-129850) (GH-131079) - Add alignment requirement - Mention that ob_size is unreliable if you don't control it - Add some links for context - basicsize should include the base type in generaly not just PyObject - suggest Py_SIZE & Py_SET_SIZE This adds a “by-the-way” link to `PyObject_New`, which shouldn't be used for GC types. In order to be comfortable linking to it, I also add a link to `PyObject_GC_New` from its docs. And the same for `*Var` variants, while I'm here. (cherry picked from commit ad0f618) Co-authored-by: Petr Viktorin <encukou@gmail.com>
| Back | FazBrowse Home | New Git URL |
This adds a “by-the-way” link to PyObject_New, which shouldn't be used for GC types. In order to be comfortable linking to it, I also add a link to PyObject_GC_New from its docs. And the same for *Var variants, while I'm here.
📚 Documentation preview 📚: https://cpython-previews--129850.org.readthedocs.build/