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-119180: Add VALUE_WITH_FAKE_GLOBALS format to annotationlib by JelleZijlstra · Pull Request #124415 · python/cpython

gh-119180: Add VALUE_WITH_FAKE_GLOBALS format to annotationlib #124415

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
JelleZijlstra merged 12 commits into python:main from JelleZijlstra:pep649-fakevalue
Nov 26, 2024

Uh oh!

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

Merged

gh-119180: Add VALUE_WITH_FAKE_GLOBALS format to annotationlib #124415

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit Hold shift + click to select a range
ddacdb7
gh-119180: Add VALUE_WITH_FAKE_GLOBALS format to annotationlib
JelleZijlstra Sep 24, 2024
5bb1d1e
Merge remote-tracking branch 'upstream/main' into pep649-fakevalue
JelleZijlstra Sep 25, 2024
ab05089
Change the values
JelleZijlstra Sep 25, 2024
3ba132a
fix constevaluator
JelleZijlstra Sep 25, 2024
26f1c7c
Merge branch 'main' into pep649-fakevalue
JelleZijlstra Sep 25, 2024
2012bb4
fix tests
JelleZijlstra Sep 26, 2024
f77be37
Merge remote-tracking branch 'upstream/main' into pep649-fakevalue
JelleZijlstra Sep 26, 2024
80818c6
Merge branch 'main' into pep649-fakevalue
JelleZijlstra Sep 28, 2024
4081f8f
Add C enum for format
JelleZijlstra Sep 29, 2024
3d382ba
Merge remote-tracking branch 'upstream/main' into pep649-fakevalue
JelleZijlstra Nov 20, 2024
10df40d
Merge remote-tracking branch 'upstream/main' into pep649-fakevalue
JelleZijlstra Nov 26, 2024
718205f
Rename poorly named variable
JelleZijlstra Nov 26, 2024
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

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

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

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

Diff view
Diff view
Prev Previous commit
Next Next commit
fix tests
  • Loading branch information

Uh oh!

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

@JelleZijlstra
JelleZijlstra committed Sep 26, 2024
commit 2012bb477d017ce3bab648da14b960c57ab956e0

There are no files selected for viewing

2 changes: 2 additions & 0 deletions 2 Lib/annotationlib.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,8 @@ def get_annotations(
# But if we didn't get it, we use __annotations__ instead.
ann = _get_dunder_annotations(obj)
return ann
case Format.VALUE_WITH_FAKE_GLOBALS:
raise ValueError("The VALUE_WITH_FAKE_GLOBALS format is for internal use only")
case _:
raise ValueError(f"Unsupported format {format!r}")

Expand Down
4 changes: 4 additions & 0 deletions 4 Lib/test/test_annotationlib.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,8 @@ def foo(a: int, b: str):

foo.__annotations__ = {"a": "foo", "b": "str"}
for format in annotationlib.Format:
if format is Format.VALUE_WITH_FAKE_GLOBALS:
continue
with self.subTest(format=format):
self.assertEqual(
annotationlib.get_annotations(foo, format=format),
Expand Down Expand Up @@ -778,6 +780,8 @@ def __annotations__(self):

wa = WeirdAnnotations()
for format in Format:
if format is Format.VALUE_WITH_FAKE_GLOBALS:
continue
with (
self.subTest(format=format),
self.assertRaisesRegex(
Expand Down
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 01402520 — 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.