-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
bugmypy got something wrongmypy got something wrong
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: strYour 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
ggeorge-pros, sanderr, adxl, popatam and teplandr
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrong