Skip to content

Conversation

@erlend-aasland
Copy link
Contributor

@erlend-aaslanderlend-aasland commented Jul 13, 2023

@AlexWaygood
Copy link
Member

AlexWaygood commented Jul 13, 2023

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

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

@erlend-aasland
Copy link
ContributorAuthor

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

@erlend-aasland
Copy link
ContributorAuthor

Aaah, perhaps it is line 801 and 802:

assertisinstance(parameters[0].converter, self_converter) delparameters[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.

@AlexWaygood
Copy link
Member

Aaah, perhaps it is line 801 and 802:

assertisinstance(parameters[0].converter, self_converter) delparameters[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.

@AlexWaygood
Copy link
Member

AlexWaygood commented Jul 14, 2023

Does f9cb537 look good to you?

@erlend-aaslanderlend-aasland marked this pull request as ready for review July 14, 2023 11:44
@erlend-aasland
Copy link
ContributorAuthor

Does f9cb537 look good to you?

Neat!

@AlexWaygood
Copy link
Member

Thanks!

@AlexWaygoodAlexWaygood enabled auto-merge (squash) July 14, 2023 11:47
@AlexWaygoodAlexWaygood merged commit 7c95345 into python:mainJul 14, 2023
@erlend-aaslanderlend-aasland deleted the clinic/annotate-output-templates branch July 14, 2023 12:26
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@erlend-aasland@AlexWaygood@bedevere-bot