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

Pylance doesn’t seem to know about the int.bit_count method #6786

Closed
Openstreetmapler opened this issue Dec 18, 2024 · 5 comments
Closed
Assignees
Labels
needs repro Issue has not been reproduced yet

Comments

@Openstreetmapler
Copy link

Environment data

  • Pylance version: unknown, shipped with the Microsoft VSCode Python extension, version 2024.22.0
    • Pylance doesn’t appear as a separate entry in my VSCodium extension manager.
  • OS and version: Ubuntu 22.04
  • Python version: Python 3.10.12 at path /bin/python3

Code Snippet

Type the following into VSCode/VSCodium:

number = 123
number.bit_count()

While typing the second line, the Python extension will suggest bit_length but not bit_count even though the latter function was added to the int class with Python 3.10.

Expected behavior

After typing number.bit_, both bit_count and bit_length are suggested as auto-completions.

Actual behavior

After typing number.bit_, only bit_length is suggested.

Logs

N/A – I don’t think this issue needs a log trace as it’s just a missing feature or oversight, in my opinion.

@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Dec 18, 2024
@rchiodo
Copy link
Contributor

rchiodo commented Dec 18, 2024

This does work but you have to select an interpreter that's 3.10 or higher:

Image

The interpreter down here:

Image

If say I pick a 3.9 interpreter, I get this:

Image

@rchiodo rchiodo closed this as completed Dec 18, 2024
@Openstreetmapler
Copy link
Author

This does work but you have to select an interpreter that's 3.10 or higher:

Image
I have the choice between three interpreters which are all version 3.10.12. Therefore, please reopen the issue.

@Openstreetmapler
Copy link
Author

Image

The issue also occurs on macOS 12.7.5. And yes, I’m also using Python 3.10 or higher in this case!

@rchiodo
Copy link
Contributor

rchiodo commented Dec 20, 2024

Can you include the log as described here?

https://github.com/microsoft/pylance-release/blob/main/TROUBLESHOOTING.md#filing-an-issue

That should tell us which version we think python is. It might be that the version you picked doesn't run for some reason and we can't get the version information from it.

@Openstreetmapler
Copy link
Author

Openstreetmapler commented Dec 21, 2024

Can you include the log as described here?

https://github.com/microsoft/pylance-release/blob/main/TROUBLESHOOTING.md#filing-an-issue

No, I can’t. For me, "python.analysis.logLevel": "Trace" is displayed as Unknown Configuration Setting and there’s also no Pylance: Start Logging command available. I instead tried Developer: Set Log Level…, setting it to Trace, but this doesn’t print out useful info …

Wait a moment, I found this in the logs:

[info] Starting Jedi language server for [workspace folder].

As I prefer VSCodium over the faux-open-source VSCode, I’m actually using the Jedi language server, not Pylance.
Therefore, I’ll repost this issue on the Jedi repository. You can change the issue status to Not planned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs repro Issue has not been reproduced yet
Projects
None yet
Development

No branches or pull requests

3 participants