You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using pdoc to generate documentation for Pydantic BaseModel classes, warnings appear about parsing type annotations for __pydantic_private__ and __pydantic_extra__ attributes. The warning indicates that a 'function' object is not subscriptable when trying to parse the type annotations dict[str, Any] | None.
This occurs even with simple Pydantic model definitions and affects the documentation generation process.
Steps to reproduce the behavior:
Install pdoc and pydantic
Create a Python file with the following content:
frompydanticimportBaseModelclassFoo(BaseModel):
"""Test model"""bar: intclassBar(BaseModel):
"""Another test model"""foo: Foo
Run pdoc foobar.py, warning appears:
Warn: Error parsing type annotation dict[str, Any] | None for pydantic.main.BaseModel.__pydantic_private__: 'function' object is
not subscriptable(.../lib/python3.13/site-packages/pdoc/doc_types.py:123)
Warn: Error parsing type annotation dict[str, Any] | None for pydantic.main.BaseModel.__pydantic_extra__: 'function' object is not subscriptable(.../lib/python3.13/site-packages/pdoc/doc_types.py:123)
Problem Description
When using pdoc to generate documentation for Pydantic BaseModel classes, warnings appear about parsing type annotations for
__pydantic_private__
and__pydantic_extra__
attributes. The warning indicates that a 'function' object is not subscriptable when trying to parse the type annotationsdict[str, Any] | None
.This occurs even with simple Pydantic model definitions and affects the documentation generation process.
Steps to reproduce the behavior:
pdoc foobar.py
, warning appears:System Information
pdoc: 15.0.1
Python: 3.13.2
Platform: macOS-10.16-x86_64-i386-64bit-Mach-O
pydantic: 2.10.6
The text was updated successfully, but these errors were encountered: