Skip to content

Commit

Permalink
Apply functools.wraps to Module methods to preserve docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
bowlingmh committed Jul 5, 2023
1 parent b7c6f63 commit 948b633
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion equinox/_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ def __init__(self, method):
def __get__(self, instance, owner):
if instance is None:
return self.method
return jtu.Partial(self.method, instance)
_method = ft.wraps(self.method)(jtu.Partial(self.method, instance))
delattr(_method, "__wrapped__")
return _method


def _not_magic(k: str) -> bool:
Expand Down

0 comments on commit 948b633

Please sign in to comment.