pdoc icon indicating copy to clipboard operation
pdoc copied to clipboard

Any way to hide Pydantic 2.0 class internals?

Open aaronsteers opened this issue 1 year ago • 2 comments
trafficstars

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

aaronsteers avatar Jul 12 '24 17:07 aaronsteers