from dataclasses import dataclass
from typing import Union
from marshmallow_dataclass import add_schema
@add_schema
@dataclass(frozen=True)
class Person:
name: str
age: Union[int, float]
Person.Schema().load({"name": "jane", "age": 50.0})
Error:
$ mypy main.py --ignore-missing-imports
app/main.py:14: error: "Type[Person]" has no attribute "Schema" [attr-defined]
Found 1 error in 1 file (checked 1 source file)
mypy complains about the following code:
Error:
This is not an issue with: