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
I have a module that defines big nested data structure that is based on Pydantic. For the examples below, I use pydantic as an example even though this happens with any base-class. Minimal version is like this.
kernc
changed the title
Make it possible to ignore class members with the same name from all classes
Make it possible to ignore class members based on wildcard strings
Aug 2, 2024
I've had a similar issue with PySide6 inserting a staticMetaObject into every widget class (in a private project).
It's easily solved by fnmatch'ing anything with a * in the _is_whitelisted()/_is_blacklisted() function. There will need to be an added check for the "key does not exist" warning, but I'm tempted to just skip the warning if the name has a wildcard (without doing an extensive check in the self._context.blacklisted).
So far, it seems to work quite fine, but I do not know if it won't break something somewhere else (beside having an overly greedy matching).
I have a module that defines big nested data structure that is based on Pydantic. For the examples below, I use pydantic as an example even though this happens with any base-class. Minimal version is like this.
I would want to use
__pdoc__
variable to ignore theBaseModel
's methods from the documentation, as they appear under each of these classes.However, I don't want to disable inheritance altogether with the
--config
flag, as this is the only case where inherited members are not desired.Expected Behavior
Something like the following removes the documentation for these inherited members from all the classes in the module where this is defined.
Actual Behavior
Produces the following:
UserWarning: __pdoc__-overriden key '*.model_fields' does not exist in module 'MY_MODULE'
And there is no change in documentation.
Steps to Reproduce
pip install pydantic
__pdoc__
parameter as defined in the expected behaviourConfiguration
,ConfA
andConfB
Additional info
The text was updated successfully, but these errors were encountered: