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-104050: Add more type annotations to Argument Clinic by erlend-aasland · Pull Request #104628 · python/cpython

Conversation

@erlend-aasland

@erlend-aasland erlend-aasland commented May 18, 2023 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor
  • class Class
  • class Module
  • class PythonParser
  • function compute_checksum()
  • function parse_file()
  • variable unsupported_special_methods
  • Issue: Add type annotations to clinic.py #104050

Sorry, something went wrong.

Uh oh!

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

All reactions
@erlend-aasland
pythongh-104050: Add more typing annotations to Argument Clinic
f6fcbf0
- class Class
- class Module
- class PythonParser
- function compute_checksum()
- function parse_file()
- variable unsupported_special_methods
@erlend-aasland erlend-aasland added the skip news label May 18, 2023
@erlend-aasland
erlend-aasland requested a review from AlexWaygood May 18, 2023 21:53
@bedevere-bot bedevere-bot added the awaiting core review label May 18, 2023
@bedevere-bot bedevere-bot mentioned this pull request May 18, 2023
Add type annotations to clinic.py #104050
Closed
AlexWaygood
AlexWaygood reviewed May 18, 2023
View reviewed changes
Comment thread Tools/clinic/clinic.py Resolved

Uh oh!

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

AlexWaygood
AlexWaygood reviewed May 18, 2023
View reviewed changes
Comment thread Tools/clinic/clinic.py Resolved

Uh oh!

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

erlend-aasland added 2 commits May 19, 2023 00:25
@erlend-aasland
Pull in main
9068126
@erlend-aasland
Address review and remove some incorrect annotations
51078a6
AlexWaygood
AlexWaygood reviewed May 18, 2023
View reviewed changes
Comment thread Tools/clinic/clinic.py
Comment on lines +2304 to +2305
self.modules: ModuleDict = collections.OrderedDict()
self.classes: ClassDict = collections.OrderedDict()

@AlexWaygood AlexWaygood May 18, 2023 •
edited
Loading

Uh oh!

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

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.

Since we're touching these lines anyway: do these need to be OrderedDicts anymore? Regular dicts are guaranteed by the language spec to be ordered on 3.7+ (and clinic now requires 3.10+), and regular dicts are faster than OrderedDicts. OrderedDicts are mainly there for backwards compatibility these days (they have a few fancy methods that dicts don't have, but I really doubt we need any of them in clinic.py).

Sorry, something went wrong.

Uh oh!

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

All reactions

@AlexWaygood AlexWaygood May 18, 2023

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.

Could leave this to another PR, though

Sorry, something went wrong.

Uh oh!

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

erlend-aasland reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@erlend-aasland erlend-aasland May 18, 2023

Copy link
Copy Markdown
Contributor 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.

Yes, regular dicts should be fine post 3.7.

Sorry, something went wrong.

Uh oh!

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

All reactions
AlexWaygood
AlexWaygood approved these changes May 18, 2023
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels May 18, 2023
@erlend-aasland
erlend-aasland enabled auto-merge (squash) May 18, 2023 22:53
@erlend-aasland erlend-aasland changed the title gh-104050: Add more typing annotations to Argument Clinic gh-104050: Add more type annotations to Argument Clinic May 18, 2023
@erlend-aasland
erlend-aasland merged commit 94c8eda into python:main May 18, 2023
@bedevere-bot bedevere-bot removed the awaiting merge label May 18, 2023
carljm added a commit to carljm/cpython that referenced this pull request May 18, 2023
@carljm
Merge branch 'main' into nestedcomps
54095f0
* main:
  pythongh-74690: Don't set special protocol attributes on non-protocol subclasses of protocols (python#104622)
  pythongh-104623: Update Windows installer to use SQLite 3.42.0 (python#104625)
  pythongh-104050: Add more type annotations to Argument Clinic (python#104628)
  pythongh-104629: Don't skip test_clinic if _testclinic is missing (python#104630)
  pythongh-104549: Set __module__ on TypeAliasType (python#104550)
  pythongh-104050: Improve some typing around `default`s and sentinel values (python#104626)
  pythongh-104146: Remove unused vars from Argument Clinic (python#104627)
  pythongh-104615: don't make unsafe swaps in apply_static_swaps (python#104620)
  pythonGH-104484: Add case_sensitive argument to `pathlib.PurePath.match()` (pythonGH-104565)
  pythonGH-96803: Document and test new unstable internal frame API functions (pythonGH-104211)
  pythonGH-104580: Don't cache eval breaker in interpreter (pythonGH-104581)
@erlend-aasland
erlend-aasland deleted the typed-clinic/pre-parser branch May 21, 2023 20:59
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

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

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