Convenience method for intersections

This commit is contained in:
Elod Csirmaz 2024-08-19 23:05:03 +01:00
parent ce87745b14
commit ab13342ab5

View file

@ -201,6 +201,10 @@ class Object:
def union(self, objects: TUnion[list, 'Object']) -> 'Object':
"""Form the union of self and an object or list of objects"""
return Union(child=Collection.c(objects)._add(self))
def intersection(self, objects: TUnion[list, 'Object']) -> 'Object':
"""Get the intersection of self and an object of list of objects"""
return Intersection(child=Collection.c(objects)._add(self))
class Header: