File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change 3030 >>> combined_spec &= " !=1.1"
3131 >>> combined_spec
3232 <SpecifierSet('!=1.1,>=1.0,~=1.0')>
33+ >>> # We can iterate over the SpecifierSet to recover the
34+ >>> # individual specifiers
35+ >>> sorted (combined_spec, key = str )
36+ [<Specifier('!=1.1')>, <Specifier('>=1.0')>, <Specifier('~=1.0')>]
3337 >>> # Create a few versions to check for contains.
3438 >>> v1 = Version(" 1.0a5" )
3539 >>> v2 = Version(" 1.0" )
Original file line number Diff line number Diff line change @@ -823,6 +823,9 @@ def __iter__(self) -> Iterator[Specifier]:
823823 """
824824 Returns an iterator over all the underlying :class:`Specifier` instances
825825 in this specifier set.
826+
827+ >>> sorted(SpecifierSet(">=1.0.0,!=1.0.1"), key=str)
828+ [<Specifier('!=1.0.1')>, <Specifier('>=1.0.0')>]
826829 """
827830 return iter (self ._specs )
828831
You can’t perform that action at this time.
0 commit comments