neo4j / neo4j-python-driver

Neo4j Bolt driver for Python
https://neo4j.com/docs/api/python-driver/current/
Other
882 stars 187 forks source link

Fix internal transaction method forwarding #1017

Closed robsdedude closed 5 months ago

robsdedude commented 5 months ago

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