Skip to content

Commit 8adec66

Browse files
committed
str is a class not a function.
1 parent 398edf1 commit 8adec66

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

domdf_python_tools/doctools.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def wrapper(target: F) -> F:
230230
# __repr__ is defined within the function
231231
"__setattr__": "Implement :func:`setattr(self, name) <setattr>`.",
232232
"__sizeof__": "Returns the size of the object in memory, in bytes.",
233-
"__str__": "Return :func:`str(self) <str>`.", # __subclasshook__
233+
"__str__": "Return :class:`str(self) <str>`.", # __subclasshook__
234234
}
235235

236236
# Check against dict
@@ -321,12 +321,15 @@ def _do_prettify(obj: Type, base: Type, new_docstrings: Dict[str, str]):
321321
if not PYPY and isinstance(attribute, (WrapperDescriptorType, MethodDescriptorType, MethodWrapperType)):
322322
continue
323323

324+
if attribute is None:
325+
continue
326+
324327
base_docstring: Optional[str] = None
325328
if hasattr(base, attr_name):
326329
base_docstring = getattr(base, attr_name).__doc__
327330

328331
doc: Optional[str] = attribute.__doc__
329-
if doc in {None, base_docstring} and attribute is not None:
332+
if doc in {None, base_docstring}:
330333
attribute.__doc__ = new_docstrings[attr_name]
331334

332335

0 commit comments

Comments
 (0)