Skip to content

Commit 3313691

Browse files
committed
Follow naming convention for covariant typevars
Signed-off-by: Joe Friedrichsen <[email protected]>
1 parent 6d8318b commit 3313691

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/nipanel/_converters.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@
99
from google.protobuf import any_pb2, wrappers_pb2
1010
from google.protobuf.message import Message
1111

12-
TPythonType_co = TypeVar("TPythonType_co", covariant=True)
13-
TProtobufType_co = TypeVar("TProtobufType_co", bound=Message, covariant=True)
12+
_TPythonType_co = TypeVar("_TPythonType_co", covariant=True)
13+
_TProtobufType_co = TypeVar("_TProtobufType_co", bound=Message, covariant=True)
1414

1515
_logger = logging.getLogger(__name__)
1616

1717

18-
class Converter(Generic[TPythonType_co, TProtobufType_co], ABC):
18+
class Converter(Generic[_TPythonType_co, _TProtobufType_co], ABC):
1919
"""A class that defines how to convert between Python objects and protobuf Any messages."""
2020

2121
@property
2222
@abstractmethod
23-
def python_type(self) -> Type[TPythonType_co]:
23+
def python_type(self) -> Type[_TPythonType_co]:
2424
"""The Python type that this converter handles."""
2525

2626
@property
2727
@abstractmethod
28-
def protobuf_message(self) -> Type[TProtobufType_co]:
28+
def protobuf_message(self) -> Type[_TProtobufType_co]:
2929
"""The type-specific protobuf message for the Python type."""
3030

3131
@property
@@ -38,7 +38,7 @@ def to_protobuf(self, python_value: Any) -> any_pb2.Any:
3838
"""Convert the Python object to its type-specific message and pack it as any_pb2.Any."""
3939

4040
@abstractmethod
41-
def to_python(self, protobuf_value: any_pb2.Any) -> TPythonType_co:
41+
def to_python(self, protobuf_value: any_pb2.Any) -> _TPythonType_co:
4242
"""Convert the protobuf message to its matching Python type."""
4343

4444

0 commit comments

Comments
 (0)