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

comb missing from math module #293

Closed
SaadiSave opened this issue Aug 28, 2020 · 5 comments
Closed

comb missing from math module #293

SaadiSave opened this issue Aug 28, 2020 · 5 comments
Labels
fixed in next version (main) A fix has been implemented and will appear in an upcoming version

Comments

@SaadiSave
Copy link

Environment data

  • Language Server version: 2020.8.2
  • OS and version: Ubuntu 20.04 LTS
  • Python version (& distribution if applicable, e.g. Anaconda): 3.8.2

Expected behaviour

from math import comb

Import resolved without errors

Actual behaviour

Screenshot from 2020-08-28 09-14-17

But the class works perfectly when used in:

O = inp(9, 0.32, [4, 5])
O.setdist()
print(O.rnddist(4))

Logs

None

Code Snippet / Additional information

None
@jakebailey
Copy link
Member

You have a typeCheckingMode above "off", so you're seeing these sorts of type errors. The type stubs for math do not declare comb: https://github.com/python/typeshed/blob/master/stdlib/2and3/math.pyi

I can see that the python docs say it exists in 3.8+: https://docs.python.org/3.8/library/math.html#math.comb

So this is a typeshed bug and would need to be fixed there. The stub contains other things added in 3.8, so it was likely an oversight.

@erictraut
Copy link
Contributor

I just submitted a PR to the typeshed repo to add the missing function: python/typeshed#4489

@github-actions github-actions bot removed the triage label Aug 28, 2020
@jakebailey jakebailey added the fixed in next version (main) A fix has been implemented and will appear in an upcoming version label Aug 29, 2020
@jakebailey jakebailey changed the title Pylance unable to resolve import comb missing from math module Aug 29, 2020
@SaadiSave
Copy link
Author

Has an update been released to fix the issue?

@jakebailey
Copy link
Member

jakebailey commented Sep 2, 2020

No, not yet. We release once a week, typically Wednesday or Thursday. We close the issues marked as "fixed in next version" when the fix is available.

@jakebailey
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

4 participants