Skip to content

Commit

Permalink
Revert "Fix TokenFactory.create_value value caching for unhashable va…
Browse files Browse the repository at this point in the history
…lues"

This reverts commit 5108e07.
  • Loading branch information
rbaltrusch committed Jun 23, 2024
1 parent 6d43406 commit f3a87af
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions natscript/internal/token_.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,7 @@ def create_value(self, value: Hashable) -> tokenvalue.Value:
"""Returns a new Value object if value cannot be found in the value cache,
otherwise returns the existing Value from the cache.
"""
try:
return self._value_cache.get(value, tokenvalue.Value(value))
except TypeError: # unhashable
return tokenvalue.Value(value)
return self._value_cache.get(value, tokenvalue.Value(value))

@staticmethod
def create_iterable_value(value: Iterable[Any]) -> tokenvalue.IterableValue:
Expand Down

0 comments on commit f3a87af

Please sign in to comment.