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 — Update ``symtable`` stubs for 3.13 and 3.14 by picnixz · Pull Request #12183 · python/typeshed

Conversation

@picnixz

@picnixz picnixz commented Jun 22, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

This incorporates the changes of the following PRs:

  • gh-120029: export DEF_TYPE_PARAM compiler flag cpython#120028
  • gh-120029: make symtable.Symbol.__repr__ correctly reflect the compiler's flags  cpython#120099
  • gh-119698: fix symtable.Class.get_methods and document its behaviour correctly cpython#120151
  • gh-119933 : Improve SyntaxError message for invalid type parameters expressions cpython#119976

@JelleZijlstra Should I also write the stubs for _symtable or should I leave it to the IDEs? (PyCharm generates it automatically from the compiled file, but I don't know for others).

Sorry, something went wrong.

Uh oh!

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

All reactions
picnixz and others added 2 commits June 22, 2024 14:49
@picnixz
Update symtable stubs for 3.13 and 3.14
f24fa4d
@pre-commit-ci
[pre-commit.ci] auto fixes from pre-commit.com hooks
97f5a44
@picnixz

picnixz commented Jun 22, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member Author

(Ah I think the methods were only in 3.13.0b3 actually)

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

@picnixz
picnixz marked this pull request as draft June 22, 2024 12:55
picnixz added 3 commits June 22, 2024 14:58
@picnixz
add missing method introduced in 3.14
4bf6911
@picnixz
Merge branch 'update-symtable' of github.com:picnixz/typeshed into up…
4083c50
…date-symtable
@picnixz
add missing method introduced in 3.14
97f603a
@github-actions

This comment has been minimized.

Sign in to view
@AlexWaygood

AlexWaygood commented Jun 22, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Looks like we'll have to wait for the release of 3.13b3 before adding the new-in-3.13 methods. They exist on 3.13b3 but not on 3.13b2, so stubtest is complaining.

I'd be fine with any of the following options:

  1. leaving the PR open for a bit until 3.13b3 is out
  2. cutting out the 3.13 additions for now and just merging the 3.14 additions
  3. merge the PR as-is, but add allowlist entries to this file to shut up stubtest until 3.13b3 is out: https://github.com/python/typeshed/blob/main/stdlib/%40tests/stubtest_allowlists/py313.txt. (Once 3.13b3 is released, stubtest will immediately start complaining about the allowlist entries being unused, so there's no chance of us forgetting to get rid of the allowlist entries.)
All reactions

Sorry, something went wrong.

Uh oh!

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

@AlexWaygood

AlexWaygood commented Jun 22, 2024

Copy link
Copy Markdown
Member

@JelleZijlstra Should I also write the stubs for _symtable or should I leave it to the IDEs? (PyCharm generates it automatically from the compiled file, but I don't know for others).

Unless there's a specific reason why someone might want or need to import something from _symtable rather than symtable, I'd prefer it if we avoided writing stubs for these internal modules which are implementation details of the runtime.

(If anything from _symtable was reexported from symtable as public API, I could make a case for including the module, as it's generally good to accurately reflect in the stubs the module things were actually defined in. But it doesn't look like anything is reexported in symtable as public API.)

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

@picnixz

picnixz commented Jun 22, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member Author

Looks like we'll have to wait for the release of 3.13b3 before adding the new-in-3.13 methods

Yes that's what I was just checking! since docs.python.org reports 3.13b2 I thought it was the "next" release and not the one that was "just" released. Not sure if it's possible for the docs to actually know which feature was added after a release and that is not yet available in the release that can be downloaded. I'll ask Hugo on CPython for that.

leaving the PR open for a bit until 3.13b3 is out

I think it's easier to do that. It's less error-prone (otherwise, I'd need to update the allow_list afterwards, so it's still 2 commits where 1 could have been fine), and more complete IMO (because if someone has 3.14, they would also expect the features from 3.13 since it was written in the docs that this feature was available). And I don't want to change 3.13 with 3.14 and then change it back again afterwards... (also, the use of an enumeration is somewhat breaking between 3.12 and 3.13 so it's important to know that in 3.13, something changed IMO).

I'll leave it as a draft until the next release.

But it doesn't look like anything is reexported in symtable as public API.

No, indeed. It's just importing names but since _socket also had that kind of treatment (where there are a lot of constants), I wondered about it. But if I don't need to, it's easier for me!

All reactions

Sorry, something went wrong.

Uh oh!

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

@AlexWaygood

AlexWaygood commented Jun 22, 2024

Copy link
Copy Markdown
Member

the use of an enumeration is somewhat breaking between 3.12 and 3.13

I hope it isn't! Since instances of StrEnum are also instances of str (and all members of a StrEnum enumeration are instances of StrEnum), it should be fully backwards compatible, no?

All reactions

Sorry, something went wrong.

Uh oh!

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

@AlexWaygood AlexWaygood added the status: deferred Issue or PR deferred until some precondition is fixed label Jun 22, 2024
@picnixz

picnixz commented Jun 22, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member Author

Actually, the types are compatible but not the values. We did not change what is returned in 3.12.x but in 3.13, it was decided to change the values. Because the old values were incorrect (semantically speaking, like "TypeVar bound" was returned for the symbol table of a default type parameter value...). And we used an enumeration to avoid a constant string which could not be changed in the future.

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

@AlexWaygood

AlexWaygood commented Jun 22, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Got it, thanks! (And thanks for the PR!)

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

@AlexWaygood AlexWaygood removed the status: deferred Issue or PR deferred until some precondition is fixed label Jul 1, 2024
@AlexWaygood
Merge branch 'main' into update-symtable
e3e5668
@github-actions

github-actions Bot commented Jul 1, 2024

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

All reactions

Sorry, something went wrong.

Uh oh!

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

@AlexWaygood
AlexWaygood marked this pull request as ready for review July 1, 2024 22:48
AlexWaygood
AlexWaygood approved these changes Jul 1, 2024
View reviewed changes

@AlexWaygood AlexWaygood 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.

Thanks!

Sorry, something went wrong.

Uh oh!

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

picnixz reacted with hooray emoji
All reactions
  • 🎉 1 reaction
@AlexWaygood
AlexWaygood merged commit 6b4cd03 into python:main Jul 1, 2024
@picnixz
picnixz deleted the update-symtable branch July 2, 2024 06:54
max-muoto pushed a commit to max-muoto/typeshed that referenced this pull request Sep 8, 2024
@picnixz @max-muoto
Update symtable stubs for 3.13 and 3.14 (python#12183)
866a4d0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@AlexWaygood AlexWaygood AlexWaygood 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.

2 participants

@picnixz @AlexWaygood
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.