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: Argument Clinic: Annotate output_templates() by erlend-aasland · Pull Request #106732 · python/cpython

Conversation

@erlend-aasland

@erlend-aasland erlend-aasland commented Jul 13, 2023 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor
  • 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: Argument Clinic: Annotate output_templates()
adaaa9c
@erlend-aasland
erlend-aasland requested a review from AlexWaygood as a code owner July 13, 2023 23:12
@erlend-aasland erlend-aasland added the skip news label Jul 13, 2023
@bedevere-bot bedevere-bot added the awaiting core review label Jul 13, 2023
@bedevere-bot bedevere-bot mentioned this pull request Jul 13, 2023
Add type annotations to clinic.py #104050
Closed
@erlend-aasland
erlend-aasland marked this pull request as draft July 13, 2023 23:15
@bedevere-bot bedevere-bot removed the awaiting core review label Jul 13, 2023
@AlexWaygood

AlexWaygood commented Jul 13, 2023 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

The mypy error might indicate we have the wrong annotation for Parameter.converter

Edit: no, don't think that's the issue actually

All reactions

Sorry, something went wrong.

Uh oh!

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

@AlexWaygood
Fix some reachability-analysis errors
6891e14
@erlend-aasland

erlend-aasland commented Jul 14, 2023

Copy link
Copy Markdown
Contributor Author

Thanks for 6891e14! The last error puzzles me, though, and I have no bandwidth for this today; if you find a solution, feel free to land this :)

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 Jul 14, 2023

Copy link
Copy Markdown
Member

The last error puzzles me, though, and I have no bandwidth for this today; if you find a solution, feel free to land this

Yeah, I can't immediately tell what the issue is here. I'm investigating :)

Mypy doesn't have a great understanding of multiple inheritance, so this may be a false positive. But not sure.

All reactions

Sorry, something went wrong.

Uh oh!

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

@erlend-aasland

erlend-aasland commented Jul 14, 2023

Copy link
Copy Markdown
Contributor Author

Aaah, perhaps it is line 801 and 802:

assert isinstance(parameters[0].converter, self_converter)
del parameters[0]

My guess: mypy uses only the information provided in line 801, but is not smart enough to see that line 802 invalidates that assert, so it continues to think parameters[0] is asserted as a self_converter instance.

All reactions

Sorry, something went wrong.

Uh oh!

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

@AlexWaygood

AlexWaygood commented Jul 14, 2023

Copy link
Copy Markdown
Member

Aaah, perhaps it is line 801 and 802:

assert isinstance(parameters[0].converter, self_converter)
del parameters[0]

My guess: mypy uses only the information provided in line 801, but is not smart enough to see that line 802 invalidates that assert, so it continues to think parameters[0] is asserted as a self_converter instance.

Bingo! I'll push a fix.

erlend-aasland reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

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

@AlexWaygood
Fix last mypy error
f9cb537
@AlexWaygood

AlexWaygood commented Jul 14, 2023 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Does f9cb537 look good to you?

erlend-aasland reacted with rocket emoji
All reactions
  • 🚀 1 reaction

Sorry, something went wrong.

Uh oh!

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

AlexWaygood
AlexWaygood reviewed Jul 14, 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
erlend-aasland marked this pull request as ready for review July 14, 2023 11:44
@bedevere-bot bedevere-bot added the awaiting core review label Jul 14, 2023
@erlend-aasland

erlend-aasland commented Jul 14, 2023

Copy link
Copy Markdown
Contributor Author

Does f9cb537 look good to you?

Neat!

All reactions

Sorry, something went wrong.

Uh oh!

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

AlexWaygood
AlexWaygood approved these changes Jul 14, 2023
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Jul 14, 2023
@AlexWaygood

AlexWaygood commented Jul 14, 2023

Copy link
Copy Markdown
Member

Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

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

@AlexWaygood
AlexWaygood enabled auto-merge (squash) July 14, 2023 11:47
@AlexWaygood
AlexWaygood merged commit 7c95345 into python:main Jul 14, 2023
@bedevere-bot bedevere-bot removed the awaiting merge label Jul 14, 2023
@erlend-aasland
erlend-aasland deleted the clinic/annotate-output-templates branch July 14, 2023 12:26
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.