GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GH-95245: Document use of `MANAGED` flags instead of offsets. by markshannon · Pull Request #96044 · python/cpython

Conversation

@markshannon

@markshannon markshannon commented Aug 17, 2022 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • Issue: Reduce the size of plain Python objects from 8 to 6 machine words. #95245

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
markshannon added 2 commits August 17, 2022 13:53
@markshannon
Update section on adding weakrefs.
6b6d032
@markshannon
Update c-api docs regarding tp_dictoffset and tp_weaklistoffset.
9211dbd
@markshannon markshannon added docs Documentation in the Doc dir skip news labels Aug 17, 2022
@bedevere-bot bedevere-bot added the awaiting core review label Aug 17, 2022
markshannon added 2 commits August 17, 2022 14:50
@markshannon
Fix typo
bd5cad4
@markshannon
Fix formatting.
5ad1362
@markshannon
markshannon requested a review from mdboom August 17, 2022 16:10
mdboom
mdboom requested changes Aug 24, 2022
View reviewed changes
Comment thread Doc/c-api/structures.rst

The legacy offsets :c:member:`~PyTypeObject.tp_dictoffset` and
:c:member:`~PyTypeObject.tp_weaklistoffset` are still supported, but extensions are
strongly encouraged to use ``Py_TPFLAGS_MANAGED_DICT`` and

@mdboom mdboom Aug 24, 2022

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can Py_TPFLAGS_MANAGED_DICT and Py_TPFLAGS_MANAGED_WEAKREF link to their definition in typeobj.rst below?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@markshannon markshannon Aug 30, 2022

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:c:member:~PyTypeObject.tp_dictoffset` converts to a link to
https://docs.python.org/3/c-api/typeobj.html#c.PyTypeObject.tp_dictoffset
I don't think I can link into the table.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/c-api/typeobj.rst
| | | __ge__ | | | | |
+------------------------------------------------+-----------------------------------+-------------------+---+---+---+---+
| :c:member:`~PyTypeObject.tp_weaklistoffset` | :c:type:`Py_ssize_t` | | | X | | ? |
| (:c:member:`~PyTypeObject.tp_weaklistoffset`) | :c:type:`Py_ssize_t` | | | X | | ? |

@mdboom mdboom Aug 24, 2022

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parentheses indicate deprecation? Should we maybe say "(Deprecated in Python 3.12)" instead?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@markshannon markshannon Aug 30, 2022

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs are always relevant to the current version, so it is implicit that this applies to 3.12.
This isn't a formal deprecation, more of a hint not to use these fields.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/c-api/typeobj.rst
| | | __delete__ | | | | |
+------------------------------------------------+-----------------------------------+-------------------+---+---+---+---+
| :c:member:`~PyTypeObject.tp_dictoffset` | :c:type:`Py_ssize_t` | | | X | | ? |
| (:c:member:`~PyTypeObject.tp_dictoffset`) | :c:type:`Py_ssize_t` | | | X | | ? |

@mdboom mdboom Aug 24, 2022

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above regarding deprecation.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/c-api/typeobj.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/extending/newtypes.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@markshannon
Implement mdboom's suggestions.
a508c00
@markshannon
markshannon merged commit 0f733ff into python:main Aug 30, 2022
@bedevere-bot bedevere-bot removed the awaiting core review label Aug 30, 2022
@markshannon
markshannon deleted the document-preheader-further branch September 26, 2023 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@mdboom mdboom mdboom requested changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

docs Documentation in the Doc dir skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@markshannon @mdboom @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.