Skip to content

Commit

Permalink
fix: include properties
Browse files Browse the repository at this point in the history
  • Loading branch information
BobTheBuidler committed Nov 30, 2024
1 parent 27be912 commit 0e6bc05
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions a_sync/iter.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -175,17 +175,13 @@ class _AwaitableAsyncIterableMixin(AsyncIterable[T]):
# Update method docstrings by redefining methods
# This is necessary because, by default, subclasses inherit methods from their bases
# which means if we just update the docstring we might edit docs for unrelated objects
def is_function(name: str, obj: Any) -> bool:
return (
isinstance(obj, (FunctionType, property))
or "cython_function_or_method" in type(obj).__name__
)
is_function = lambda obj: isinstance(obj, (FunctionType, property)) or "cython_function_or_method" in type(obj).__name__
cdef dict functions_to_redefine = {
attr_name: attr_value
for attr_name in dir(cls)
if (attr_value := getattr(cls, attr_name, None))
and is_function(attr_name, attr_value)
and is_function(attr_value)
and attr_value.__doc__
and any(pattern in attr_value.__doc__ for pattern in _FORMAT_PATTERNS)
}
Expand Down

0 comments on commit 0e6bc05

Please sign in to comment.