Skip to content

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

Closed
@hugovk

Description

@hugovk

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions