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

No attribute 'nbytes' on memoryview [attribute-error] #1225

Closed
anarkiwi opened this issue Jun 9, 2022 · 1 comment
Closed

No attribute 'nbytes' on memoryview [attribute-error] #1225

anarkiwi opened this issue Jun 9, 2022 · 1 comment
Assignees
Labels
bug cat: stubs and 3p type stubs and third-party types

Comments

@anarkiwi
Copy link

anarkiwi commented Jun 9, 2022

Discovered by @ltindall.

$ pytype --version
2022.06.06
$ python3 --version
Python 3.10.4
$ cat test.py
print(memoryview(b'123').nbytes)
$ python3 test.py
3
$ pytype test.py
Computing dependencies
Analyzing 1 sources with 0 local dependencies
ninja: Entering directory `.pytype'
[1/1] check test
FAILED: /home/josh/tmp/.pytype/pyi/test.pyi
/usr/bin/python3 -m pytype.single --imports_info /home/josh/tmp/.pytype/imports/test.imports --module-name test --platform linux -V 3.10 -o /home/josh/tmp/.pytype/pyi/test.pyi --analyze-annotated --nofail --quick /home/josh/tmp/test.py
File "/home/josh/tmp/test.py", line 1, in : No attribute 'nbytes' on memoryview [attribute-error]

For more details, see https://google.github.io/pytype/errors.html#attribute-error
ninja: build stopped: subcommand failed.
Leaving directory '.pytype'

@rchen152 rchen152 added bug cat: stubs and 3p type stubs and third-party types labels Jun 9, 2022
@rchen152 rchen152 self-assigned this Jun 9, 2022
@rchen152
Copy link
Contributor

rchen152 commented Jun 9, 2022

Huh, nbytes has been around since Python 3.3! I'm surprised we've gone this long without anyone noticing it was missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cat: stubs and 3p type stubs and third-party types
Projects
None yet
Development

No branches or pull requests

2 participants