From 0e6bc0530bc73e9d11f2af40609e3ae760e50fb5 Mon Sep 17 00:00:00 2001 From: BobTheBuidler Date: Sat, 30 Nov 2024 19:54:57 +0000 Subject: [PATCH] fix: include properties --- a_sync/iter.pyx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/a_sync/iter.pyx b/a_sync/iter.pyx index e236c332..40c07b97 100644 --- a/a_sync/iter.pyx +++ b/a_sync/iter.pyx @@ -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) }