Skip to content

Commit aceedd8

Browse files
committed
ConstraintExpression: Add __iter__.
Signed-off-by: Chris PeBenito <[email protected]>
1 parent 582f883 commit aceedd8

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

setools/policyrep.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ class ConstraintExpression(PolicyObject):
333333
def __ge__(self, other) -> bool: ...
334334
def __getitem__(self, index) -> Union[str, FrozenSet[TypeOrAttr], FrozenSet[Role], FrozenSet[User]]: ...
335335
def __gt__(self, other) -> bool: ...
336+
def __iter__(self) -> Iterator[Union[FrozenSet[Role], FrozenSet[Type], FrozenSet[User], str]]: ...
336337
def __le__(self, other) -> bool: ...
337338
def __lt__(self, other) -> bool: ...
338339
def __ne__(self, other) -> bool: ...

setools/policyrep/constraint.pxi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ cdef class ConstraintExpression(PolicyObject):
174174
def __getitem__(self, idx):
175175
return self._postfix[idx]
176176

177+
def __iter__(self):
178+
return iter(self._postfix)
179+
177180
def __eq__(self, other):
178181
return self._postfix == other
179182

0 commit comments

Comments
 (0)