From cdc0c22e4b2e955379d471cddb5f715939bc0242 Mon Sep 17 00:00:00 2001 From: rechen Date: Fri, 10 Jun 2022 09:42:59 -0700 Subject: [PATCH] Add missing memoryview.nbytes attribute. Fixes https://github.com/google/pytype/issues/1225. PiperOrigin-RevId: 454183699 --- pytype/stubs/builtins/builtins.pytd | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pytype/stubs/builtins/builtins.pytd b/pytype/stubs/builtins/builtins.pytd index 31dd41257..3860ed19a 100644 --- a/pytype/stubs/builtins/builtins.pytd +++ b/pytype/stubs/builtins/builtins.pytd @@ -941,13 +941,14 @@ class slice(object): class memoryview(object): __slots__ = [] - format = ... # type: str - itemsize = ... # type: int - shape = ... # type: Optional[Tuple[int, ...]] - strides = ... # type: Optional[Tuple[int, ...]] - suboffsets = ... # type: Optional[Tuple[int, ...]] - readonly = ... # type: bool - ndim = ... # type: int + format: str + itemsize: int + nbytes: int + shape: Optional[Tuple[int, ...]] + strides: Optional[Tuple[int, ...]] + suboffsets: Optional[Tuple[int, ...]] + readonly: bool + ndim: int def __init__(self, object: bytes) -> NoneType: ... def __getitem__(self, index: int) -> int: ... def __getitem__(self, index: slice) -> memoryview: ...