mirror of
https://github.com/kennethreitz/pydantic.git
synced 2026-06-05 23:00:18 +00:00
f2c3a49d66
* Don't override pre-existing `__init__` method in MyPy plugin * Add change file
16 lines
259 B
Python
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')
|