diff --git a/vyper/ast/nodes.py b/vyper/ast/nodes.py index fb5fb73592..0ebe18ab5d 100644 --- a/vyper/ast/nodes.py +++ b/vyper/ast/nodes.py @@ -4,6 +4,7 @@ import decimal import functools import operator +import pickle import sys import warnings from typing import Any, Optional, Union @@ -357,6 +358,9 @@ def __hash__(self): values = [getattr(self, i, None) for i in VyperNode.__slots__ if not i.startswith("_")] return hash(tuple(values)) + def __deepcopy__(self, memo): + return pickle.loads(pickle.dumps(self)) + def __eq__(self, other): if not isinstance(other, type(self)): return False @@ -786,7 +790,6 @@ class ExprNode(VyperNode): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - self._expr_info = None