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 — bpo-42747: Remove Py_TPFLAGS_HAVE_AM_SEND and make Py_TPFLAGS_HAVE_VERSION_TAG no-op by encukou · Pull Request #27260 · python/cpython

Conversation

@encukou

@encukou encukou commented Jul 20, 2021 •
edited by miss-islington
Loading

Uh oh!

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

Copy link
Copy Markdown
Member
  • Remove code that checks Py_TPFLAGS_HAVE_VERSION_TAG

    The field is always present in the type struct, as explained
    in the added comment.

  • Remove Py_TPFLAGS_HAVE_AM_SEND

    The flag is not needed, and since it was added in 3.10 it can be removed now.

https://bugs.python.org/issue42747

Automerge-Triggered-By: GH:encukou

Sorry, something went wrong.

Uh oh!

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

All reactions
encukou added 3 commits July 20, 2021 16:34
@encukou
Remove code that checks Py_TPFLAGS_HAVE_VERSION_TAG
bdad9e8
The field is always present in the type struct, as explained
in the added comment.
@encukou
Remove Py_TPFLAGS_HAVE_AM_SEND
91ccfc4
The flag is not needed.
@encukou
Add a blurb
7a19100
@encukou encukou added the needs backport to 3.10 label Jul 20, 2021
@encukou
encukou requested review from 1st1, asvetlov, corona10, pablogsal, serhiy-storchaka and vstinner July 20, 2021 14:40
@encukou
encukou requested a review from markshannon as a code owner July 20, 2021 14:40
@bedevere-bot bedevere-bot added the awaiting core review label Jul 20, 2021
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Jul 20, 2021
@encukou
encukou force-pushed the remove-unnecessary-tpflags branch from f3ea135 to 7a19100 Compare July 20, 2021 14:40
pablogsal
pablogsal approved these changes Jul 20, 2021
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Jul 20, 2021
@pablogsal

pablogsal commented Jul 20, 2021

Copy link
Copy Markdown
Member

How this flag was added and when it was turned into a no-op?

All reactions

Sorry, something went wrong.

Uh oh!

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

corona10
corona10 approved these changes Jul 20, 2021
View reviewed changes
@encukou

encukou commented Jul 20, 2021 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member Author

Py_TPFLAGS_HAVE_* flags have been historically added whenever a new field was added to the type struct, to make it possible to use extensions compiled for earlier Python versions (where the fields aren't present).
But extensions need to be recompiled for each feature version (as long I can remember, and definitely in Python 3.0+), or use the stable ABI (where types use the interpreter's memory layout).

This PR turns both into no-ops, as they should be.
One of the removed code paths probably has an issue, see bpo-44588 -- but I didn't investigate that deeper yet.

shihai1991 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

shihai1991
shihai1991 reviewed Jul 20, 2021
View reviewed changes
Comment thread Misc/NEWS.d/next/C API/2021-07-20-16-21-06.bpo-42747.rRxjUY.rst
@@ -0,0 +1,4 @@
The ``Py_TPFLAGS_HAVE_VERSION_TAG`` type flag now does nothing. The
``Py_TPFLAGS_HAVE_AM_SEND`` flag (which was added in 3.10) is removed. Both

@shihai1991 shihai1991 Jul 20, 2021

Copy link
Copy Markdown
Member

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.

Py_TPFLAGS_HAVE_AM_SEND flag (which was added in 3.10) is removed.

there aren't many users use it?

Sorry, something went wrong.

Uh oh!

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

All reactions

@encukou encukou Jul 21, 2021

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.

If there any users of it, they are using the 3.10 betas. Requiring that they remove the flag is fair game.

Sorry, something went wrong.

Uh oh!

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

All reactions
shihai1991
shihai1991 approved these changes Jul 21, 2021
View reviewed changes
@encukou encukou added the 🤖 automerge label Jul 23, 2021
@miss-islington
miss-islington merged commit a4760cc into python:main Jul 23, 2021
@miss-islington

miss-islington commented Jul 23, 2021

Copy link
Copy Markdown
Contributor

Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot bedevere-bot removed the awaiting merge label Jul 23, 2021
@bedevere-bot

bedevere-bot commented Jul 23, 2021

Copy link
Copy Markdown

GH-27306 is a backport of this pull request to the 3.10 branch.

All reactions

Sorry, something went wrong.

Uh oh!

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

@encukou
encukou deleted the remove-unnecessary-tpflags branch July 23, 2021 13:21
@bedevere-bot bedevere-bot removed the needs backport to 3.10 label Jul 23, 2021
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 23, 2021
@encukou @miss-islington
bpo-42747: Remove Py_TPFLAGS_HAVE_AM_SEND and make Py_TPFLAGS_HAVE_VE…
ab38497
…RSION_TAG no-op (pythonGH-27260)

* Remove code that checks Py_TPFLAGS_HAVE_VERSION_TAG

    The field is always present in the type struct, as explained
    in the added comment.

* Remove Py_TPFLAGS_HAVE_AM_SEND

    The flag is not needed, and since it was added in 3.10 it can be removed now.
(cherry picked from commit a4760cc)

Co-authored-by: Petr Viktorin <[email protected]>
encukou added a commit that referenced this pull request Jul 23, 2021
@miss-islington @encukou
bpo-42747: Remove Py_TPFLAGS_HAVE_AM_SEND and make Py_TPFLAGS_HAVE_VE…
632e8a6
…RSION_TAG no-op (GH-27260) (GH-27306)

* Remove code that checks Py_TPFLAGS_HAVE_VERSION_TAG

    The field is always present in the type struct, as explained
    in the added comment.

* Remove Py_TPFLAGS_HAVE_AM_SEND

    The flag is not needed, and since it was added in 3.10 it can be removed now.
(cherry picked from commit a4760cc)

Co-authored-by: Petr Viktorin <[email protected]>
@vstinner

vstinner commented Aug 9, 2021

Copy link
Copy Markdown
Member

Thanks for this fix @encukou. The rationale for Py_TPFLAGS_HAVE_AM_SEND was unclear. Now it's well defined, it's useless :-D

All reactions

Sorry, something went wrong.

Uh oh!

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

@Wesley-Jzy Wesley-Jzy mannequin mentioned this pull request Jul 21, 2022
Possible double Py_XDECREF in cpython typeobject.c #88754
Closed
@colesbury colesbury mentioned this pull request Dec 9, 2024
Stale entries in MRO cache if MRO contains non-base classes #127773
Closed
@encukou encukou mentioned this pull request Dec 13, 2024
gh-127773: Disable attribute cache on incompatible MRO entries #127924
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@corona10 corona10 corona10 approved these changes
@shihai1991 shihai1991 shihai1991 approved these changes
@pablogsal pablogsal pablogsal approved these changes
@vstinner vstinner Awaiting requested review from vstinner
@1st1 1st1 Awaiting requested review from 1st1 1st1 is a code owner
@asvetlov asvetlov Awaiting requested review from asvetlov asvetlov is a code owner
@serhiy-storchaka serhiy-storchaka Awaiting requested review from serhiy-storchaka
@markshannon markshannon Awaiting requested review from markshannon markshannon is a code owner

Uh oh!

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

Assignees

No one assigned

Labels

None yet

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.

8 participants

@encukou @pablogsal @miss-islington @bedevere-bot @vstinner @corona10 @shihai1991 @the-knights-who-say-ni
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.