From c2bbc10082da8e3b11d2fe4576db9719b25054e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Wed, 10 Jul 2024 21:14:03 +0200 Subject: [PATCH] refactor: Simplify "is imported" check in `is_public` property --- src/_griffe/mixins.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/_griffe/mixins.py b/src/_griffe/mixins.py index 95df759d..d932b914 100644 --- a/src/_griffe/mixins.py +++ b/src/_griffe/mixins.py @@ -468,8 +468,7 @@ def is_public(self) -> bool: # TODO: In a future version, we will support two conventions regarding imports: # - `from a import x as x` marks `x` as public. # - `from a import *` marks all wildcard imported objects as public. - # The following condition effectively filters out imported objects. - if self.is_alias and not (self.inherited or (self.parent and self.parent.is_alias)): # type: ignore[attr-defined] + if self.is_imported: # YORE: Bump 1.0.0: Replace line with `return False`. return _False # type: ignore[return-value]