Skip to content

Any way to hide Pydantic 2.0 class internals?  #715

@aaronsteers

Description

@aaronsteers

Problem Description

My class declaration has no members declared explicitly. However, the pdoc text generated includes some garbage internals from the Pydantic class, while not actually documenting any of the superclass's members. I would like to just globally suppress these:

  • model_config
  • model_post_init
  • model_fields
  • model_computed_fields

My class documentation index looks like this since migrating to Pydantic 2.0:

image

Since I'm not declaring these directly in my own code, I don't have a way to suppress them with a @private annotation or similar.

Steps to reproduce the behavior:

Create a class from Pydantic 2.0 BaseModel.

System Information

Paste the output of "pdoc --version" here.

pdoc: 14.5.1
Python: 3.10.12
Platform: macOS-14.5-arm64-arm-64bit

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions