Files
pydantic/tests/mypy/modules/custom_constructor.py
Patrick Arminio f2c3a49d66 Don't override __init__ method in MyPy plugin if it already exists (#3824)
* Don't override pre-existing `__init__` method in MyPy plugin

* Add change file
2022-08-10 10:54:38 +01:00

16 lines
259 B
Python

from pydantic import BaseModel
class Person(BaseModel):
id: int
name: str
birth_year: int
def __init__(self, id: int) -> None:
super().__init__(id=id, name='Patrick', birth_year=1991)
Person(1)
Person(id=1)
Person(name='Patrick')