Skip to content
Snippets Groups Projects
Commit 48dfa3c9 authored by Todd Gamblin's avatar Todd Gamblin Committed by Harmen Stoppels
Browse files

Spec: prefer a splice-specific method to `__len__` (#47585)


Automatic splicing say `Spec` grow a `__len__` method but it's only used
in one place and it's not clear the semantics are useful elsewhere. It also
runs the risk of Specs one day being confused for other types of containers.

Rather than introduce a new function for one algorithm, let's use a more
specific method in the splice code.

- [x] Use topological ordering in `_resolve_automatic_splices` instead of 
      sorting by node count
- [x] delete `Spec.__len__()` and `Spec.__bool__()`

---------

Signed-off-by: default avatarTodd Gamblin <tgamblin@llnl.gov>
Co-authored-by: default avatarGreg Becker <becker33@llnl.gov>
Co-authored-by: default avatarMassimiliano Culpo <massimiliano.culpo@gmail.com>
parent e5c411d8
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment