-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Process
: Have inputs
property always return AttributesFrozenDict
(
#6010) The `Process.inputs` property as implemented in `plumpy` has as a return type `AttributesFrozenDict | None`. This leads to a lot unnecessary complexities in the code having to deal with the potential `None`, where really this should never really occur. A lot of user code will never even check for `Process.inputs` returning `None`, such as in `WorkChain` implementations, and as a result type checkers will fail forcing a user to either unnecessarily complicate their code by explicitly checking for `None`, but will typically end up silencing the error. The `inputs` property is overridden here to return an empty `AttributesFrozenDict` in case the inputs are `None`, which allows to simplify the return type and get rid of any type errors in downstream code.
- Loading branch information
Showing
4 changed files
with
20 additions
and
11 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