-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit ensures that `find` functions fail with `Not_found` consistently with their documentation. The inconsistency was introduced for `Py.Object.find`, `Py.Object.find_string`, `Py.Dict.find` and `Py.Dict.find_string` by commit af7e79a which replaced the dedicated function `Pyutils.option_unwrap` by `Option.get`, which raises `Invalid_argument _` instead of `Not_found`. The inconsistency was present since the beginning for `Py.Object.find_attr_string` and `Py.Object.find_attr`. Functions `Py.Object.find_err`, `Py.Object.find_string_err`, `Py.Object.find_attr_err`, `Py.Object.find_attr_string_err` have been introduced for cases where keeping the underlying Python exception is preferable. For instance, `Py.Module.get` is now an alias for `Py.Object.find_attr_string_err` to keep the current behavior of failing with a Python exception. Suggested by jonathan-laurent: #96
- Loading branch information
1 parent
1fc5390
commit 6e72b45
Showing
5 changed files
with
164 additions
and
18 deletions.
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
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
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