Skip to content

Commit

Permalink
Remove abc.ABCMeta derivation of Predicate
Browse files Browse the repository at this point in the history
I think this is causing a problem with Python <= 3.10 when specifying
Predicate with a "name" argument.
  • Loading branch information
daveraja committed May 6, 2024
1 parent 3a6ca8c commit e648a6d
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions clorm/orm/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3272,12 +3272,7 @@ def __iter__(self) -> Iterator[PredicatePath]:
# ------------------------------------------------------------------------------


# Mixin class to be able to use both MetaClasses
class _AbstractPredicateMeta(abc.ABCMeta, _PredicateMeta):
pass


class Predicate(object, metaclass=_AbstractPredicateMeta):
class Predicate(object, metaclass=_PredicateMeta):
"""Abstract base class to encapsulate an ASP predicate or complex term.
This is the heart of the ORM model for defining the mapping of a predicate
Expand Down Expand Up @@ -3445,12 +3440,10 @@ def __neg__(self):
# --------------------------------------------------------------------------
# Overloaded operators
# --------------------------------------------------------------------------
@abc.abstractmethod
def __eq__(self, other):
"""Overloaded boolean operator."""
raise NotImplementedError("Predicate.__eq__() must be overriden")

@abc.abstractmethod
def __lt__(self, other):
"""Overloaded boolean operator."""
raise NotImplementedError("Predicate.__lt__() must be overriden")
Expand All @@ -3459,17 +3452,14 @@ def __le__(self, other):
"""Overloaded boolean operator."""
raise NotImplementedError("Predicate.__le__() must be overriden")

@abc.abstractmethod
def __ge__(self, other):
"""Overloaded boolean operator."""
raise NotImplementedError("Predicate.__ge__() must be overriden")

@abc.abstractmethod
def __gt__(self, other):
"""Overloaded boolean operator."""
raise NotImplementedError("Predicate.__gt__() must be overriden")

@abc.abstractmethod
def __hash__(self):
"""Overload the hash function."""
raise NotImplementedError("Predicate.__hash__() must be overriden")
Expand Down

0 comments on commit e648a6d

Please sign in to comment.