Improve sphinx.ext.autodoc docstrings

This commit is contained in:
Louis Maddox 2021-07-18 23:59:15 +01:00 committed by GitHub
parent 9eff0a6950
commit b81ad1c154
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,7 +30,7 @@ logger = logging.getLogger(__name__)
def mangle(subject: Any, name: str) -> str:
"""mangle the given name."""
"""Mangle the given name."""
try:
if isclass(subject) and name.startswith('__') and not name.endswith('__'):
return "_%s%s" % (subject.__name__, name)
@ -41,7 +41,7 @@ def mangle(subject: Any, name: str) -> str:
def unmangle(subject: Any, name: str) -> Optional[str]:
"""unmangle the given name."""
"""Unmangle the given name."""
try:
if isclass(subject) and not name.endswith('__'):
prefix = "_%s__" % subject.__name__