Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Single underscore methods are not filtered out in 0.28.0 #264

Closed
hugovk opened this issue Mar 16, 2025 · 2 comments
Closed

bug: Single underscore methods are not filtered out in 0.28.0 #264

hugovk opened this issue Mar 16, 2025 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@hugovk
Copy link

hugovk commented Mar 16, 2025

Description of the bug

https://mkdocstrings.github.io/python/usage/configuration/members/#filters says:

The default value (["!^_[^_]"]) means: render every object, except those starting with one underscore, unless they start with two underscores. It means that an object whose name is hello, __hello, or hello will be rendered, but not one whose name is _hello.

This is the case with mkdocstrings 0.27.0, where single underscored methods are not included, but starting in 0.28.0 (and the latest 0.28.2), they are included.

To Reproduce

git clone https://github.com/python-humanize/humanize
cd humanize
edit docs/requirements.txt # change to mkdocstrings[python]==0.27.0 or mkdocstrings[python]==0.28.0
rm -rf site; tox -r -e docs && open site/time/index.html

With 0.28.0:

image

Expected behavior

With 0.27.0:

image

Environment information

python -m mkdocstrings_handlers.python.debug  # | xclip -selection clipboard
  • System: macOS-15.3.2-arm64-arm-64bit-Mach-O
  • Python: cpython 3.13.2 (/Users/hugo/github/humanize/.tox/docs/bin/python)
  • Environment variables:
  • Installed packages:
    • mkdocs v1.6.1
    • mkdocstrings v0.28.0
    • mkdocstrings-python v1.16.1
    • griffe v1.6.0
@hugovk hugovk added the unconfirmed This bug was not reproduced yet label Mar 16, 2025
@pawamoy pawamoy added bug Something isn't working and removed unconfirmed This bug was not reproduced yet labels Mar 16, 2025
@pawamoy
Copy link
Member

pawamoy commented Mar 16, 2025

Thanks for the report @hugovk, I was able to confirm. I forgot to apply the default filters as a default value to the relevant field in one of the dataclasses. Will be fixed in next release 🙂

@pawamoy pawamoy closed this as completed Mar 16, 2025
pawamoy added a commit that referenced this issue Mar 16, 2025
Issue-264: #264
@hugovk
Copy link
Author

hugovk commented Mar 16, 2025

Great, thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants