Skip to content

Commit

Permalink
Merge pull request #113 from dice-group/complement_of_complement_fix
Browse files Browse the repository at this point in the history
Complement of complement fix
  • Loading branch information
Demirrr authored Nov 22, 2024
2 parents 9a613ab + dc39fd5 commit 82b5ae9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions owlapy/class_expression/class_expression.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ class OWLObjectComplementOf(OWLBooleanClassExpression, HasOperands[OWLClassExpre

_operand: OWLClassExpression

def __new__(cls, op: OWLClassExpression):
"""
Creates a new instance or returns the operand if op is already a complement.
"""
if isinstance(op, OWLObjectComplementOf):
return op.get_operand()
else:
return super(OWLObjectComplementOf, cls).__new__(cls)

def __init__(self, op: OWLClassExpression):
"""
Args:
Expand Down

0 comments on commit 82b5ae9

Please sign in to comment.