generated from pyiron/pyiron_module_template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
By default, be picker about callable
`typeguard.check_type` is quite relaxed when seeing if something is `callable` -- so much so that _everything_ will pass through, even `check_type(5, callable)`, or (as in the test suite) a check against an instance of a class that has not defined `__call__`. This switches the default to convert raw `callable` hints into `collections.abc.Callable`, which `check_type` treats more rigorously. I believe this is closer to the intuitively expected behaviour of `valid_value`, but the original behaviour can still be recovered via a flag argument. Signed-off-by: liamhuber <[email protected]>
- Loading branch information
Showing
2 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters