Skip to content

Commit

Permalink
Allow libraries to define custom MethodWithAio methods (#139)
Browse files Browse the repository at this point in the history
When you want a non-wrapped version of a method but still keep the intance.method.aio interface for async invocation
  • Loading branch information
freider authored Apr 2, 2024
1 parent 0dd645f commit f52f4bb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions synchronicity/synchronizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,9 @@ def _wrap_class(self, cls, interface, name, target_module=None):
new_dict[k] = self._wrap_proxy_classmethod(v, interface)
elif isinstance(v, property):
new_dict[k] = self._wrap_proxy_property(v, interface)
elif isinstance(v, MethodWithAio):
# if library defines its own "synchronicity-like" interface we transfer it "as is" to the wrapper
new_dict[k] = v
elif callable(v):
new_dict[k] = self._wrap_proxy_method(v, interface)

Expand Down

0 comments on commit f52f4bb

Please sign in to comment.