File size: 292 Bytes
5eb110b
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
from typing import Protocol
from abc import abstractmethod

class Example(Protocol):
    def first(self) -> int:     # This is a protocol member
        return 42

    @abstractmethod
    def second(self) -> int:    # Method without a default implementation
        raise NotImplementedError