Skip to content

Commit

Permalink
Another try to fix the bugs in is_actual_type working across all py…
Browse files Browse the repository at this point in the history
…thon versions
  • Loading branch information
egparedes committed Jan 17, 2024
1 parent 2b510d6 commit bcc4f0e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/gt4py/eve/extended_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,9 @@ def is_actual_type(obj: Any) -> TypeGuard[Type]:
and since Python 3.11:
``isinstance(typing.Any, type) is True``
"""
return isinstance(obj, type) and obj not in _ArtefactTypes
return (
isinstance(obj, type) and (obj not in _ArtefactTypes) and (type(obj) not in _ArtefactTypes)
)


if hasattr(_typing_extensions, "Any") and _typing.Any is not _typing_extensions.Any: # type: ignore[attr-defined] # _typing_extensions.Any only from >= 4.4
Expand Down

0 comments on commit bcc4f0e

Please sign in to comment.