[New-bugs-announce] [issue15731] Mechanism for inheriting docstrings and signatures

Nick Coghlan report at bugs.python.org
Mon Aug 20 06:37:32 CEST 2012


New submission from Nick Coghlan:

While working on #8810, I was reminded of the problem of wanting to inherit docstrings while replacing a method implementation.

The abstract base class method docstrings for tzinfo.utcoffset and tzinfo.dst are also correct for the concrete subclasses in the pure Python and the C versions. However, the docstrings currently need to be duplicated in all 3 places manually.

functools.wraps already plays in this space, but arguably asserts *too much* about the relationship between components

A couple of descriptors on bound and unbound methods (for __doc__ and __signature__) could have dealt with this fairly easily, but we don't have unbound methods any more :(

----------
components: Library (Lib)
messages: 168618
nosy: eric.snow, ncoghlan
priority: normal
severity: normal
status: open
title: Mechanism for inheriting docstrings and signatures
type: enhancement
versions: Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15731>
_______________________________________


More information about the New-bugs-announce mailing list