forked from HQU-gxy/camera-extrinsic-play
x
This commit is contained in:
16
protocol.py
Normal file
16
protocol.py
Normal file
@ -0,0 +1,16 @@
|
||||
from typing import Protocol, TypeVar, Generic
|
||||
|
||||
T = TypeVar("T")
|
||||
|
||||
|
||||
class Adder(Generic[T], Protocol):
|
||||
def add(self, a: T, b: T) -> T: ...
|
||||
|
||||
|
||||
class AdderImpl(Adder[int]):
|
||||
acc: int
|
||||
|
||||
def add(self, a: int, b: int):
|
||||
self.acc = a + b
|
||||
return self.acc
|
||||
|
||||
Reference in New Issue
Block a user