Skip to content

Instantly share code, notes, and snippets.

@cassioeskelsen
Created November 6, 2021 23:51
Show Gist options
  • Save cassioeskelsen/afe00a54a0ed94ca5e93468f8da8111e to your computer and use it in GitHub Desktop.
Save cassioeskelsen/afe00a54a0ed94ca5e93468f8da8111e to your computer and use it in GitHub Desktop.
from abc import abstractmethod
from typing import List, Protocol, runtime_checkable
from dataclasses import dataclass
@dataclass
class Customer:
id: int
name: str
@runtime_checkable
class CustomerRepository(Protocol):
@abstractmethod
def get_customers(self) -> List[Customer]:
""" retorna uma lista de clientes"""
@abstractmethod
def get_special_customers(self) -> List[Customer]:
""" retorna uma lista de clientes especiais"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment