Skip to content

Commit 50f57f0

Browse files
committed
fix(patterns): reference the correct attribute in sugar
1 parent 0d14b14 commit 50f57f0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

koerce/patterns.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -280,11 +280,11 @@ def __or__(self, other: Pattern) -> AnyOf:
280280
New pattern that matches if either of the patterns match.
281281
"""
282282
if isinstance(self, AnyOf) and isinstance(other, AnyOf):
283-
return AnyOf(*self.patterns, *other.patterns)
283+
return AnyOf(*self.inners, *other.inners)
284284
elif isinstance(self, AnyOf):
285-
return AnyOf(*self.patterns, other)
285+
return AnyOf(*self.inners, other)
286286
elif isinstance(other, AnyOf):
287-
return AnyOf(self, *other.patterns)
287+
return AnyOf(self, *other.inners)
288288
else:
289289
return AnyOf(self, other)
290290

@@ -301,11 +301,11 @@ def __and__(self, other: Pattern) -> AllOf:
301301
New pattern that matches if both of the patterns match.
302302
"""
303303
if isinstance(self, AllOf) and isinstance(other, AllOf):
304-
return AllOf(*self.patterns, *other.patterns)
304+
return AllOf(*self.inners, *other.inners)
305305
elif isinstance(self, AllOf):
306-
return AllOf(*self.patterns, other)
306+
return AllOf(*self.inners, other)
307307
elif isinstance(other, AllOf):
308-
return AllOf(self, *other.patterns)
308+
return AllOf(self, *other.inners)
309309
else:
310310
return AllOf(self, other)
311311

0 commit comments

Comments
 (0)