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

Can't type hints for collections.Counter #229

Closed
grasssand opened this issue Aug 12, 2020 · 2 comments
Closed

Can't type hints for collections.Counter #229

grasssand opened this issue Aug 12, 2020 · 2 comments
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version

Comments

@grasssand
Copy link

Environment data

  • Language Server version: 2020.8.0
  • OS and version: Manjaro
  • Python version (& distribution if applicable, e.g. Anaconda): 3.8.5

Expected behaviour

no warning

Actual behaviour

Expected class type but received "_Alias"

Logs


Code Snippet / Additional information

import collections
from typing import ChainMap, Counter, DefaultDict, OrderedDict

a: Counter = collections.Counter()

a1: Counter[str] = collections.Counter()

b: OrderedDict = collections.OrderedDict()

c: ChainMap = collections.ChainMap()

d: DefaultDict = collections.defaultdict()

2020-08-12_09-49

@erictraut
Copy link
Contributor

Thanks for the bug report. I wasn't aware there was a special alias "Counter" exported by the typing module. I've added support for it. This issue will be fixed in the next release of Pylance.

@erictraut erictraut added bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version labels Aug 12, 2020
@github-actions github-actions bot removed the triage label Aug 12, 2020
@jakebailey
Copy link
Member

This issue has been fixed in version 2020.8.1, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/master/CHANGELOG.md#202081-13-august-2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version
Projects
None yet
Development

No branches or pull requests

3 participants