Skip to content

Commit

Permalink
refactor: Simplify "is imported" check in is_public property
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Jul 14, 2024
1 parent 3c2825f commit c2bbc10
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/_griffe/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down

0 comments on commit c2bbc10

Please sign in to comment.