Forwarding methods shouldn't be decorated with functools.wraps as it not only copies the docs string and type annotations (desirable), but also __name__, __qualname__, and more (undesirable).
While wraps can be configured with what properties to copy, it turns out that there is no need to keep the doc strings in the transaction base class for the forwarded methods. Instead, they are moved to the public (forwarding) methods. This still keeps the code DRY.
Forwarding methods shouldn't be decorated with
functools.wraps
as it not only copies the docs string and type annotations (desirable), but also__name__
,__qualname__
, and more (undesirable).While
wraps
can be configured with what properties to copy, it turns out that there is no need to keep the doc strings in the transaction base class for the forwarded methods. Instead, they are moved to the public (forwarding) methods. This still keeps the code DRY.Suggested in: #1015