Skip to content
Snippets Groups Projects
Commit 7c94d10a authored by Andreas Klöckner's avatar Andreas Klöckner Committed by Andreas Klöckner
Browse files

Make __getinitargs__ an abstractmethod

parent 1e8e6cd8
No related branches found
No related tags found
No related merge requests found
...@@ -21,6 +21,7 @@ THE SOFTWARE. ...@@ -21,6 +21,7 @@ THE SOFTWARE.
""" """
from sys import intern from sys import intern
from abc import ABC, abstractmethod
import pymbolic.traits as traits import pymbolic.traits as traits
...@@ -180,7 +181,7 @@ def disable_subscript_by_getitem(): ...@@ -180,7 +181,7 @@ def disable_subscript_by_getitem():
pass pass
class Expression: class Expression(ABC):
"""Superclass for parts of a mathematical expression. Overrides operators """Superclass for parts of a mathematical expression. Overrides operators
to implicitly construct :class:`Sum`, :class:`Product` and other expressions. to implicitly construct :class:`Sum`, :class:`Product` and other expressions.
...@@ -226,6 +227,10 @@ class Expression: ...@@ -226,6 +227,10 @@ class Expression:
# {{{ init arg names (override by subclass) # {{{ init arg names (override by subclass)
@abstractmethod
def __getinitargs__(self):
pass
@property @property
def init_arg_names(self): def init_arg_names(self):
raise NotImplementedError raise NotImplementedError
...@@ -539,9 +544,6 @@ class Expression: ...@@ -539,9 +544,6 @@ class Expression:
self._hash_value = self.get_hash() self._hash_value = self.get_hash()
return self._hash_value return self._hash_value
def __getinitargs__(self):
raise NotImplementedError
def __getstate__(self): def __getstate__(self):
return self.__getinitargs__() return self.__getinitargs__()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment