microsoft / pyright

Static Type Checker for Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

aliases from other modules are incorrectly marked as deprecated when `deprecateTypingAliases` is enabled if the alias has the same name as a deprecated alias

DetachHead opened this issue · comments

from collections.abc import Set as AbstractSet

def foo(a: AbstractSet[str]): # error: This type is deprecated as of Python 3.9; use "collections.abc.Set" instead
  pass

playground

collections.abc.Set is not deprecated, but it's incorrectly being treated as such because its alias has the same name as typing.AbstractSet

This is addressed in pyright 1.1.363, which I just published.