From b343ad393165058e16b4ec5a9c0c5db97e19aa4a Mon Sep 17 00:00:00 2001 From: matejcik Date: Wed, 8 Dec 2021 10:00:47 +0100 Subject: [PATCH] style(python): mark Reader/Writer protocol arguments as position-only Using `__`-prefixed names seems to be a convention for specifying position-only arguments before Python 3.8. Pyright respects this convention and in fact requires it since version 1.1.192. --- python/src/trezorlib/protobuf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/src/trezorlib/protobuf.py b/python/src/trezorlib/protobuf.py index c22e855a1..1f8e365b2 100644 --- a/python/src/trezorlib/protobuf.py +++ b/python/src/trezorlib/protobuf.py @@ -37,7 +37,7 @@ MT = TypeVar("MT", bound="MessageType") class Reader(Protocol): - def readinto(self, buf: bytearray) -> int: + def readinto(self, __buf: bytearray) -> int: """ Reads exactly `len(buffer)` bytes into `buffer`. Returns number of bytes read, or 0 if it cannot read that much. @@ -46,7 +46,7 @@ class Reader(Protocol): class Writer(Protocol): - def write(self, buf: bytes) -> int: + def write(self, __buf: bytes) -> int: """ Writes all bytes from `buffer`, or raises `EOFError` """