I have two decorated classes using attrs package as follows:
@attr.s(kw_only=True)
class Entity:
"""
base class of all entities
"""
entity_id = attr.ib(type=str)
# ...
@attr.s(kw_only=True)
class Customer(Entity):
customer_name = attr.ib(type=Name)
# ...
I get Unexpected keyword argument "entity_id" for "Customer" for code like this:
def register_customer(customer_name: str):
return Customer(
entity_id=unique_id_generator(),
customer_name=Name(full_name=customer_name),
)
So how can I make Mypy aware of the __init__ method of my parent class. I should mention that the code works perfectly and there is (at least it seems) no runtime error.