Commit Graph

5 Commits

Author SHA1 Message Date
Gregory P. Smith 9ddc022456
PEP 697: Clean up before PSC acceptance (GH-3041)
Cleanup PEP-697 before acceptance:

Clarify in the abstract that this does not apply to all types, things
like tuple and int are excluded.  But could be done in the future.

Fix ``basesize`` vs ``basicsize`` field name typos.

Remove the Open Issues section and mention that using a PyType_Spec flag
instead of a negative basicsize was rejected and offer an explanation
why.  (ultimately either way would work with similar impact)
2023-03-07 15:49:06 +01:00
Petr Viktorin fa143fa994
PEP 697: Changes based on initial implementation & docs (GH-2906)
* PEP 697: Changes based on initial implementation & docs

- Use a flag, `Py_TPFLAGS_ITEMS_AT_END`, rather than a slot. This way the subclass doesn't need to worry about items (if the superclass is set up right).
- The result of `PyObject_GetTypeDataSize` may be higher than requested by -basicsize (e.g. due to alignment). It is safe to use all of it (e.g. with memset).
- Mention that `basicsize == 0` and `itemsize == 0` already work. I’ll add explicit docs & tests though.
- Add link to initial implementation
- Add endorsements
- Add a “big picture” decision tree
- Rewording
- Mention possible flags for alternative item layouts

* Apply suggestions from code review

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-12-01 16:55:12 +01:00
Petr Viktorin eb65647442
PEP 697: Add Post-History & Discussions-To (#2827) 2022-10-12 11:19:49 +02:00
Petr Viktorin 139672b8c7
PEP 697: Rewrite (#2814)
Rewrite the motivation/rationale.
The actual proposal stays nearly the same.
2022-10-06 12:59:06 +02:00
Petr Viktorin e7446a16eb
PEP 697 (new): C-API for Extending Opaque Types (#2772) 2022-08-31 11:35:53 +02:00