Skip to content

Commit b577f3b

Browse files
committed
Use the same _AutoDocstring instance
1 parent 7c9f75b commit b577f3b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Lib/dataclasses.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1002,6 +1002,8 @@ def __get__(self, _obj, cls):
10021002
setattr(cls, '__doc__', doc)
10031003
return doc
10041004

1005+
_auto_docstring = _AutoDocstring()
1006+
10051007

10061008
def _process_class(cls, init, repr, eq, order, unsafe_hash, frozen,
10071009
match_args, kw_only, slots, weakref_slot):
@@ -1235,7 +1237,7 @@ def _process_class(cls, init, repr, eq, order, unsafe_hash, frozen,
12351237
if not getattr(cls, '__doc__'):
12361238
# Create a class doc-string lazily via descriptor protocol
12371239
# to avoid importing `inspect` module.
1238-
cls.__doc__ = _AutoDocstring()
1240+
cls.__doc__ = _auto_docstring
12391241

12401242
if match_args:
12411243
# I could probably compute this once.

0 commit comments

Comments
 (0)