mypy
c26f1297 - Allow inferring +int to be a Literal (#16910)

Commit
2 years ago
Allow inferring +int to be a Literal (#16910) This makes unary positive on integers preserve the literal value of the integer, allowing `var: Literal[1] = +1` to be accepted. Basically I looked for code handling `__neg__` and added a branch for `__pos__` as well. Fixes #16728.
Author
Parents
Loading