Python Type Comprobando el diccionario mypy
from typing_extensions import TypedDict
class Person(TypedDict):
name: str
age: int
address: str
class Employee:
def __init__(self, name:str, age:int, address:str):
self._name = name
self._age = age
self._address = address
# Returns a dictionary
# {
# "name": "ABC",
# "age": 21,
# "address": "Some Street, State, AA"
# }
def employee_details(self) -> Person:
return Person(name=self._name, age=self._age, address=self._address)
Tense Tarantula