Open
Description
Bug Report
stubgen
does not properly generate ellipses for default values set in the scope of the class body of a Pydantic model.
To Reproduce
Running stubgen -m example
# example.py
from pydantic import BaseModel
class Foo(BaseModel):
abc: int = 1
xyz: str = "abc"
Should produce
Expected Behavior
# example.pyi
from pydantic import BaseModel
class Foo(BaseModel):
abc: int = ...
xyz: str = ...
stubgen
should be populating the default annotation with ellipses, instead they are missing.
Actual Behavior
# example.pyi
from pydantic import BaseModel
class Foo(BaseModel):
abc: int
xyz: str
Your Environment
- Mypy version used:
mypy 1.8.0 (compiled: yes)
- Mypy command-line flags:
stubgen -m example
- Mypy configuration options from
mypy.ini
(and other config files):N/A
- Python version used:
3.11.8