GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — bpo-17045: Improve C-API doc for PyTypeObject. by ericsnowcurrently · Pull Request #7413 · python/cpython Conversation
|
| PyTypeObject Slot [#slots]_ Inherited [#inh]_ Type | ||
| =========================================== ================= ====================== | ||
| :c:member:`~PyTypeObject.tp_name` .. char * | ||
| :c:member:`~PyTypeObject.tp_basicsize` X int |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Py_ssize_t
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
fixed
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| =========================================== ================= ====================== | ||
| PyTypeObject Slot [#slots]_ Inherited [#inh]_ Type | ||
| =========================================== ================= ====================== | ||
| :c:member:`~PyTypeObject.tp_name` .. char * |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
const char *tp_name
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
fixed
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| :c:member:`~PyTypeObject.tp_setattro` X :c:type:`setattrofunc` | ||
| :c:member:`~PyTypeObject.tp_as_buffer` \* PyBufferProcs * | ||
| :c:member:`~PyTypeObject.tp_flags` ? long | ||
| :c:member:`~PyTypeObject.tp_doc` .. char * |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
const char *
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
fixed
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| =========================================== ================= ====================== | ||
| :c:member:`~PyTypeObject.tp_name` .. char * | ||
| :c:member:`~PyTypeObject.tp_basicsize` X int | ||
| :c:member:`~PyTypeObject.tp_itemsize` ? int |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Py_ssize_t
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
fixed
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| :c:member:`~PyTypeObject.tp_getattro` X :c:type:`getattrofunc` | ||
| :c:member:`~PyTypeObject.tp_setattro` X :c:type:`setattrofunc` | ||
| :c:member:`~PyTypeObject.tp_as_buffer` \* PyBufferProcs * | ||
| :c:member:`~PyTypeObject.tp_flags` ? long |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
unsigned long
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
fixed
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| .. XXX belongs elsewhere | ||
|
|
||
| Docs for PyGetSetDef:: |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Described in structures.rst.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
fixed
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| **Default:** | ||
|
|
||
| PyBaseObject_Type provides a tp_richcompare. However, if only |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Add markup for PyBaseObject_Type and tp_richcompare.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
fixed
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| **Default:** | ||
|
|
||
| This slot has no default. For static types, if the field is | ||
| NULL then no __dict__ gets created for instances. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Add markup for NULL and __dict__.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
fixed
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| :c:func:`PyType_GenericAlloc`, to force a standard heap | ||
| allocation strategy. | ||
|
|
||
| For static subtypess, PyBaseObject_Type uses |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Add markup for PyBaseObject_Type.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Also, subtypess -> subtypes
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
typo fixed
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
fixed
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| **Default:** | ||
|
|
||
| For static types this field has no default. This means if the | ||
| slot is defined as NULL, the type cannot be called to create new |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Add markup for NULL.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
fixed
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I'm not sure about usefulness of Default: notes. If the slot is inherited, then the default is the parent's value. It looks to me that Inheritane: notes cover this, and Default: notes don't add new information. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
If I recall correctly, there are a few slots with defaults. Would it be better to omit the "default" section in the rest of the cases? FWIW, I added the "default" section because the defaults aren't always clear. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
722cc7f to
3b7c312
Compare
|
Ah, I need to run "make suspicious". :/ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| A slot name in parentheses indicates it is (effectively) deprecated. | ||
| Names in angle brackets should be treated as read-only. | ||
| Names in square brackets are for internal use only. | ||
| An asterisk means the field must be non-*NULL*. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Can you find another notation that doesn’t look like a pointer type or dereferencing a pointer?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sure. I was following the existing convention in the file, but agree it's less clear.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Oh, you're talking about the notation in the table. :) I'll change it to something else.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| .. code-block:: none | ||
|
|
||
| X - *PyType_Ready* always sets this value (if *NULL*) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The always and brackets confuse me. Would this be more correct: “PyTypeReady sets this value if it is NULL”?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I agree that it's not as clear as I want. My goal was to emphasize that it does get set by PyType_Ready(). I'll make it more clear.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| This field is inherited by subtypes together with :c:member:`~PyTypeObject.tp_setattr`: a subtype | ||
| inherits both :c:member:`~PyTypeObject.tp_setattr` and :c:member:`~PyTypeObject.tp_setattro` from its base type when | ||
| the subtype's :c:member:`~PyTypeObject.tp_setattr` and :c:member:`~PyTypeObject.tp_setattro` are both *NULL*. | ||
| THE SUBTYpe's :c:member:`~PyTypeObject.tp_setattr` and :c:member:`~PyTypeObject.tp_setattro` are both *NULL*. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This line looks like a mistake
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Yep. I'll fix it.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| **Default:** | ||
|
|
||
| :c:type:`PyBaseObject_Type` provides a :attr:`tp_richcompare`. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Drop a or add a real noun, i.e. “provides tp_richcompare” or “provides a tp_richcompare implementation”
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
agreed
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I've addressed all review comments. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.