Apply refurb/ruff rule FURB171 (#11851)

This commit is contained in:
Dimitri Papadopoulos Orfanos
2024-01-04 04:50:23 +01:00
committed by GitHub
parent 76cd0dbe3d
commit 6e6f975cb0
2 changed files with 2 additions and 2 deletions

View File

@@ -50,7 +50,7 @@ class MetadataCollector(EnvironmentCollector):
md[node.__class__.__name__] = node.astext()
for name, value in md.items():
if name in ('tocdepth',):
if name == 'tocdepth':
try:
value = int(value)
except ValueError:

View File

@@ -330,7 +330,7 @@ def generate_autosummary_content(name: str, obj: Any, parent: Any,
if doc.objtype in ('method', 'attribute', 'property'):
ns['class'] = qualname.rsplit(".", 1)[0]
if doc.objtype in ('class',):
if doc.objtype == 'class':
shortname = qualname
else:
shortname = qualname.rsplit(".", 1)[-1]