Skip to content

Commit

Permalink
Simplify internal attrs access
Browse files Browse the repository at this point in the history
  • Loading branch information
Pliner committed Dec 17, 2024
1 parent 461e0d9 commit fcf589b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions marshmallow_recipe/generics.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ def _is_unsubscripted_type(t: TypeLike) -> bool:


def _get_orig_class(t: Any) -> type | None:
return hasattr(t, "__orig_class__") and getattr(t, "__orig_class__") or None
return getattr(t, "__orig_class__", None)


def _get_params(t: Any) -> tuple[TypeLike, ...] | None:
return hasattr(t, "__parameters__") and getattr(t, "__parameters__") or None
return getattr(t, "__parameters__", None)


def _get_orig_bases(t: Any) -> tuple[TypeLike, ...] | None:
return hasattr(t, "__orig_bases__") and getattr(t, "__orig_bases__") or None
return getattr(t, "__orig_bases__", None)


def _subscript_with_any(t: TypeLike) -> TypeLike:
Expand Down

0 comments on commit fcf589b

Please sign in to comment.