Skip to content

Commit 2b84430

Browse files
committed
Fix: DynamicClassAttribute drops explicitly provided empty docstrings
1 parent 947bb46 commit 2b84430

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Lib/types.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,10 @@ def __init__(self, fget=None, fset=None, fdel=None, doc=None):
210210
self.fget = fget
211211
self.fset = fset
212212
self.fdel = fdel
213+
if doc is None and fget is not None:
214+
doc = fget.__doc__
213215
# next two lines make DynamicClassAttribute act the same as property
214-
self.__doc__ = doc or fget.__doc__
216+
self.__doc__ = doc
215217
self.overwrite_doc = doc is None
216218
# support for abstract methods
217219
self.__isabstractmethod__ = bool(getattr(fget, '__isabstractmethod__', False))

0 commit comments

Comments
 (0)