Skip to content
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.

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

Use TypeAlias in builtins and complete a TODO item #9170

Closed
wants to merge 1 commit into from

Conversation

sobolevn
Copy link
Member

From #9158 I understood that explicit type aliases are not a goal. But, this one is special. It has a TODO item and some history to it.

I am also curious about whether mypy now supports it.

@sobolevn
Copy link
Member Author

stdlib/builtins.pyi:195: error: Unsupported left operand type for | ("object") [operator]

Not today!

@sobolevn sobolevn closed this Nov 12, 2022
@github-actions
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

Expression (https://github.com/cognitedata/Expression)
+ expression/collections/block.py:317: error: Incompatible return value type (got "int", expected "Union[_TSourceSum, Literal[0]]")  [return-value]
+ expression/collections/block.py:1036: error: Incompatible return value type (got "int", expected "Union[_TSourceSum, Literal[0]]")  [return-value]
+ expression/collections/block.py:1043: error: Incompatible return value type (got "int", expected "Union[_TSourceSum, Literal[0]]")  [return-value]

ignite (https://github.com/pytorch/ignite)
+ ignite/handlers/time_profilers.py:607: error: Incompatible types in assignment (expression has type "float", variable has type "int")  [assignment]

@AlexWaygood
Copy link
Member

I am also curious about whether mypy now supports it.

I haven't checked yet, but I wonder if python/mypy#14008 might have fixed this bug (not yet released, will be released as part of mypy 1.0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants