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 — PEP 649: Improve description of semantics and mark as accepted by larryhastings · Pull Request #3138 · python/peps

Conversation

@larryhastings

@larryhastings larryhastings commented May 5, 2023 •
edited by github-actions Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor
  • Stipulate that name resolution for annotations under 649 must be identical to stock semantics.
  • Don't specify exactly the mechanism that conformant implementations must use to implement 649. Instead, do describe how CPython might do it, but leave the actual details of how to implement 649 up to each language implementation.
  • Incorporate Jelle's suggestion that the formats for inspect.get_annotations() be in an enum.IntEnum.

📚 Documentation preview 📚: https://pep-previews--3138.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

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

All reactions
@larryhastings
Improve PEP 649's description of its semantics.
d9a17ff
* Stipulate that name resolution for annotations
  under 649 must be *identical* to stock semantics.
* *Don't* specify exactly the mechanism that conformant
  implementations must use to implement 649.  Instead,
  *do* describe how CPython might do it, but leave the
  actual details of how to implement 649 up to each
  language implementation.
* Incorporate Jelle's suggestion that the formats for
  inspect.get_annotations() be in an enum.IntEnum.
@larryhastings
larryhastings requested review from JelleZijlstra and carljm May 5, 2023 11:16
hugovk
hugovk reviewed May 5, 2023
View reviewed changes
Comment thread pep-0649.rst Resolved

Uh oh!

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

@AA-Turner AA-Turner changed the title Improve PEP 649's description of its semantics. PEP 649: Improve description of semantics May 5, 2023
@larryhastings
Fix lint.
23148f6
JelleZijlstra
JelleZijlstra reviewed May 5, 2023
View reviewed changes
Comment thread pep-0649.rst Resolved

Uh oh!

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

carljm
carljm reviewed May 5, 2023
View reviewed changes
Comment thread pep-0649.rst Resolved

Uh oh!

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

@AA-Turner AA-Turner mentioned this pull request May 5, 2023
PEP 649: Change the defined format values to an IntEnum #3127
Closed
AA-Turner
AA-Turner reviewed May 5, 2023
View reviewed changes
Comment thread pep-0649.rst Resolved

Uh oh!

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

Comment thread pep-0649.rst Resolved

Uh oh!

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

@JelleZijlstra

JelleZijlstra commented May 8, 2023

Copy link
Copy Markdown
Member

A minor suggestion brought over from #3127: maybe we should drop FORMAT_MIN and FORMAT_MAX? I don't see much use for them if there is an enum; if you really want these values you can do min(member.value for member in inspect.AnnotationFormat).

AA-Turner 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.

@larryhastings

larryhastings commented May 8, 2023

Copy link
Copy Markdown
Contributor Author

FWIW, I duplicated some work in this PR that was already in another PR, #3127. Having made the mistake, it seemed easiest to close the other PEP and do everything in this one PR. Sorry for the miasma.

All reactions

Sorry, something went wrong.

Uh oh!

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

@larryhastings

larryhastings commented May 8, 2023

Copy link
Copy Markdown
Contributor Author

A minor suggestion brought over from #3127: maybe we should drop FORMAT_MIN and FORMAT_MAX?

Done. Iterating over the enum is a better solution.

All reactions

Sorry, something went wrong.

Uh oh!

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

hugovk and others added 3 commits May 8, 2023 15:24
@hugovk @larryhastings
PEP 693: Postpone 3.12.0b1 by two weeks (python#3139)
9ace095
@JelleZijlstra @AlexWaygood
@hauntsaninja @larryhastings
PEP 695: Lazy evaluation, concrete scoping semantics, other changes (p…
108f275
…ython#3122)

- Lazy evaluation means that referencing a later type variable works at runtime
- Disallow walrus in TypeVar bounds, and also disallow yield/yield from/await
  in the same contexts
- Remove rejection of lambda lifting; that is the implementation we are using now
- Change the AST
- Change of direction on mangling
- More precise scoping rules

Co-authored-by: Alex Waygood <[email protected]>
Co-authored-by: Shantanu <[email protected]>
@larryhastings
Incorporate changes from feedback, mark Accepted.
8989c52
@larryhastings
larryhastings requested review from Yhg1s and gvanrossum as code owners May 8, 2023 22:24
@larryhastings
larryhastings removed request for Yhg1s and gvanrossum May 8, 2023 22:26
@larryhastings

larryhastings commented May 8, 2023

Copy link
Copy Markdown
Contributor Author

Huh? GitHub decided to request Guido and Thomas as reviewers. I didn't ask for that. I've removed Guido and Thomas from review requests--obviously, they're welcome to review the PR, but I don't think it's necessary. Sorry for the churn, folks.

All reactions

Sorry, something went wrong.

Uh oh!

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

larryhastings added 2 commits May 8, 2023 15:32
@larryhastings
Fix PEP 12 header *order compliance*. Wow.
af3aa36
@larryhastings
Fix Sphinx complaints.
7af54df
@JelleZijlstra

JelleZijlstra commented May 8, 2023

Copy link
Copy Markdown
Member

Huh? GitHub decided to request Guido and Thomas as reviewers. I didn't ask for that. I've removed Guido and Thomas from review requests--obviously, they're welcome to review the PR, but I don't think it's necessary. Sorry for the churn, folks.

I think you incorrectly merged in the two most recent commits on the main branch (which happen to be on 693 and 695). I'm going to click the "Update branch" button to get those commits out of the PR branch.

All reactions

Sorry, something went wrong.

Uh oh!

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

@JelleZijlstra
Merge branch 'main' into nail_down_annotation_expression_semantics
0034059
@larryhastings

larryhastings commented May 9, 2023

Copy link
Copy Markdown
Contributor Author

Thanks, Jelle. Thank goodness Git is so conceptually simple and easy to use!

JelleZijlstra reacted with laugh emoji
All reactions
  • 😄 1 reaction

Sorry, something went wrong.

Uh oh!

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

@larryhastings

larryhastings commented May 9, 2023

Copy link
Copy Markdown
Contributor Author

@AA-Turner, on the other thread you said "does this list need updating?" with regards to the format IntEnums, and I didn't know what you meant. I just now noticed: in one section, the FORWARDREF enum is 2, and in another section it's 3. Is that what you were referring to?

(And, of course, I'm fixing that now. Time to pick the final values!)

All reactions

Sorry, something went wrong.

Uh oh!

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

@larryhastings
Make enum consistent, flesh out observed semantics.
3d34d84
hugovk
hugovk reviewed May 9, 2023
View reviewed changes
Comment thread pep-0649.rst Resolved

Uh oh!

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

@larryhastings
Add "Resolution" header, as pointed out by Hugo.
06d53a4
@AA-Turner

AA-Turner commented May 9, 2023

Copy link
Copy Markdown
Member

@AA-Turner, on the other thread you said "does this list need updating?" with regards to the format IntEnums, and I didn't know what you meant.

I was referring to the repr for VALUE &c -- you'd updated the list starting on line 576 to read inspect.AnnotationFormat.VALUE, but the list starting on line 78 still read inspect.VALUE. This PR consistently uses inspect.VALUE et al., so I think the comment is moot. Thanks for following up!

A

All reactions

Sorry, something went wrong.

Uh oh!

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

@larryhastings
Switch to other URL for Resolution header.
1a316cc
carljm
carljm approved these changes May 9, 2023
View reviewed changes

@carljm carljm left a comment

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.

Left some additional comments, but I don't feel super strongly about any of them; generally this looks good to me!

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread pep-0649.rst Resolved

Uh oh!

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

Comment thread pep-0649.rst Resolved

Uh oh!

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

Comment thread pep-0649.rst Resolved

Uh oh!

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

Comment thread pep-0649.rst Resolved

Uh oh!

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

Comment thread pep-0649.rst Resolved

Uh oh!

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

@AA-Turner
Apply global_enum to inspect.AnnotationFormat
08485e9
@larryhastings

larryhastings commented May 10, 2023

Copy link
Copy Markdown
Contributor Author

Somehow I'm unable to reply directly to Carl's most recent comment. He said:

We don't have to explicitly document support for everything that is technically possible. Are there strong use cases for someone using these public inspection methods to not use the enum values?

There are not, and I expect everyone to use the enum values. I was just trying to be precise.

But, we already defined the allowable values for __annotate__; why are we defining it twice? How about we simplify the text as follows:

The format parameter on these two functions accept the same values
as the format parameter on the __annotate__ magic method
defined above; however, these format parameters also have a default
value of inspect.VALUE.

All reactions

Sorry, something went wrong.

Uh oh!

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

@larryhastings
Final? text / semantics cleanup pass.
72b8183
JelleZijlstra
JelleZijlstra reviewed May 10, 2023
View reviewed changes
Comment thread pep-0649.rst Resolved

Uh oh!

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

@larryhastings

larryhastings commented May 10, 2023

Copy link
Copy Markdown
Contributor Author

Fingers crossed that we can ship 72b8183. I believe I've addressed everybody's comments (and basically incorporated everyone's suggestions).

All reactions

Sorry, something went wrong.

Uh oh!

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

@larryhastings
"accept" -> "accepts". Bettering my Englishes.
ade4a90
@larryhastings

larryhastings commented May 10, 2023

Copy link
Copy Markdown
Contributor Author

In the words of the rare "Big Bang Bar" pinball machine:

Wow! That didn't last long.

All reactions

Sorry, something went wrong.

Uh oh!

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

JelleZijlstra
JelleZijlstra approved these changes May 10, 2023
View reviewed changes

@JelleZijlstra JelleZijlstra left a comment

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.

All the changes look good to me, thanks!

Technically, changes to accepted PEPs need SC approval. I doubt the SC would have a big problem with anything in this PR, but ideally you'll have to get their signoff. Who knows, maybe they'll insist that we really need that __locals__ attribute on functions.

Sorry, something went wrong.

Uh oh!

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

All reactions
@larryhastings

larryhastings commented May 10, 2023

Copy link
Copy Markdown
Contributor Author

Good call. I'll ping them once we're collectively happy with these changes. I bet we'll get a quick rubber stamp, and then I'll merge.

JelleZijlstra 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.

carljm
carljm approved these changes May 10, 2023
View reviewed changes

@carljm carljm left a comment

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.

Changes look good to me!

Sorry, something went wrong.

Uh oh!

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

All reactions
@larryhastings
Add new "post history" reflecting the updates.
0503ca1
@larryhastings larryhastings mentioned this pull request May 10, 2023
PEP 649 update python/steering-council#187
Closed
@CAM-Gerlach CAM-Gerlach changed the title PEP 649: Improve description of semantics PEP 649: Improve description of semantics and mark as accepted May 10, 2023
AA-Turner
AA-Turner approved these changes May 10, 2023
View reviewed changes
CAM-Gerlach
CAM-Gerlach reviewed May 10, 2023
View reviewed changes

@CAM-Gerlach CAM-Gerlach left a comment

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.

Standard reminder: You can directly apply all the suggestions you want in one go by going to Files changed -> Clicking Add to batch on each suggestion -> When done, clicking Commit

It should be noted that with this PR, the PEP is marked as accepted—I've updated the title accordingly to note this key fact.

Accepted PEP checklist:

  • SC/PEP Delegate has formally accepted/rejected the PEP and posted to the Discussions-To thread
  • Pull request title in appropriate format (PEP 123: Mark as Accepted)
  • Status changed to Accepted/Rejected
  • Resolution link points directly to SC/PEP Delegate official acceptance/rejected post
  • Acceptance/rejection notice added, if the SC/PEP delegate had major conditions or comments N/A besides updating the Python-Version
  • Discussions-To, Post-History and Python-Version up to date [Done in suggestions]

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread pep-0649.rst Resolved

Uh oh!

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

Comment thread pep-0649.rst Resolved

Uh oh!

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

@CAM-Gerlach CAM-Gerlach added the DO-NOT-MERGE label May 10, 2023
CAM-Gerlach
CAM-Gerlach reviewed May 10, 2023
View reviewed changes
Comment thread pep-0649.rst Resolved

Uh oh!

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

emilyemorehouse
emilyemorehouse reviewed May 15, 2023
View reviewed changes
Comment thread pep-0649.rst Resolved

Uh oh!

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

@larryhastings

larryhastings commented May 15, 2023

Copy link
Copy Markdown
Contributor Author

The SC is happy with the changes.

python/steering-council#187

All reactions

Sorry, something went wrong.

Uh oh!

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

larryhastings and others added 3 commits May 15, 2023 16:02
@larryhastings @CAM-Gerlach
Update post history with all conversations, courtesy CAM!
7da747a
Co-authored-by: C.A.M. Gerlach <[email protected]>
@larryhastings @emilyemorehouse
Fix typo. Thanks, Emily!
c9b0773
Co-authored-by: Emily Morehouse <[email protected]>
@larryhastings @CAM-Gerlach
Add "Discussions-To" header. Thanks, CAM!
c36b491
Co-authored-by: C.A.M. Gerlach <[email protected]>
@larryhastings larryhastings removed the DO-NOT-MERGE label May 15, 2023
@larryhastings
Attempt to satisfy "validate-post-history" hook.
7896e98
@larryhastings
larryhastings merged commit a111ec4 into python:main May 16, 2023
@larryhastings
larryhastings deleted the nail_down_annotation_expression_semantics branch May 16, 2023 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@hugovk hugovk hugovk left review comments
@emilyemorehouse emilyemorehouse emilyemorehouse left review comments
@CAM-Gerlach CAM-Gerlach CAM-Gerlach left review comments
@carljm carljm carljm approved these changes
@JelleZijlstra JelleZijlstra JelleZijlstra approved these changes
@AA-Turner AA-Turner AA-Turner approved these changes

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.

7 participants

@larryhastings @JelleZijlstra @AA-Turner @carljm @hugovk @emilyemorehouse @CAM-Gerlach
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.