Skip to content

Commit

Permalink
Fix minor formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
wesselb committed May 24, 2024
1 parent a5213dd commit bb657d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions plum/autoreload.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,8 @@ def deactivate_autoreload():
from IPython import get_ipython # type: ignore

ip = get_ipython()
if (ip is not None) and (
"IPython.extensions.storemagic" in ip.extension_manager.loaded
):
ext_loaded = "IPython.extensions.storemagic" in ip.extension_manager.loaded
if (ip is not None) and ext_loaded:
activate_autoreload()

except ImportError:
Expand Down
5 changes: 2 additions & 3 deletions plum/signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,8 @@ def _extract_signature(f: Callable, precedence: int = 0) -> Signature:
types.append(annotation)

# If there is a default parameter, make sure that it is of the annotated type.
if (p.default is not inspect.Parameter.empty) and not _is_bearable(
p.default, annotation
):
default_is_empty = p.default is inspect.Parameter.empty
if not default_is_empty and not _is_bearable(p.default, annotation):
raise TypeError(
f"Default value `{p.default}` is not an instance "
f"of the annotated type `{repr_short(annotation)}`."
Expand Down

0 comments on commit bb657d7

Please sign in to comment.