Open jesnie opened 1 day ago
Oh, here's another one:
type S = str
print(S.__value__)
errors with:
test_pylint_695.py:2:6: E1101: Class 'str' has no '__value__' member (no-member)
S
not of type str
, but of type TypeAliasType
and does have a __value__
.
Bug description
I have a medium-sized code-base I've been updating to PEP 695 typing, and I'm getting a lot of false positives.
Some minimal examples:
Errors with:
But:
Passes.
Also:
Passes
but:
Fails with:
I suspect:
class A[T]
is defining the variableT
.T
intype L[T]
.Configuration
Command used
Pylint output
Expected behavior
All of these examples should pass.
Pylint version
OS / Environment
Ubuntu 22.04.3 LTS (running under WSL)
Additional dependencies