Describe the Bug
Reproducer:
from typing import AnyStr
class A:
@classmethod
def create(cls, x: AnyStr | None): ...
def test(x: AnyStr | None):
A.create(x)
Output:
ERROR Argument `AnyStr | None` is not assignable to parameter `x` with type `str | None` in function `A.create` [bad-argument-type]
--> /tmp/foo.py:10:12
|
10 | A.create(x)
It looks like AnyStr is specialized to str? Possibly a duplicate of #2370.
Sandbox Link
No response
(Only applicable for extension issues) IDE Information
No response
Describe the Bug
Reproducer:
Output:
It looks like
AnyStris specialized tostr? Possibly a duplicate of #2370.Sandbox Link
No response
(Only applicable for extension issues) IDE Information
No response