Skip to content

Commit

Permalink
Deprecate PersistentHashWalkMapper
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Sep 23, 2024
1 parent 42943fd commit b77e590
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pymbolic/mapper/persistent_hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"""


from warnings import warn
from pymbolic.mapper import WalkMapper


Expand All @@ -33,6 +34,12 @@ class PersistentHashWalkMapper(WalkMapper):
def __init__(self, key_hash):
self.key_hash = key_hash

warn("PersistentHashWalkMapper is deprecated. "
"Since they are dataclasses, expression objects should now "
"support persistent hashing natively without any help. "
"It will be removed in 2026.",
DeprecationWarning, stacklevel=2)

def visit(self, expr):
self.key_hash.update(type(expr).__name__.encode("utf8"))
return True
Expand Down

0 comments on commit b77e590

Please sign in to comment.