You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When dealing with trees, it's quite common to use a dictionary to label nodes, using the path as the key. Currently this can be accomplished by casting the path to str, but this introduces a lot of unnecessary casts.
Ideally, PathValue should extend tuple instead of list, but since this would be a breaking change, perhaps it's better to implement __hash__ on PathValue?
I'd imagine most code would treat paths as immutable anyway.
Thoughts?
I'd be happy to submit a PR implementing whatever you decide is the best course of action.
The text was updated successfully, but these errors were encountered:
When dealing with trees, it's quite common to use a dictionary to label nodes, using the path as the key. Currently this can be accomplished by casting the path to
str
, but this introduces a lot of unnecessary casts.Ideally, PathValue should extend
tuple
instead oflist
, but since this would be a breaking change, perhaps it's better to implement__hash__
onPathValue
?I'd imagine most code would treat paths as immutable anyway.
Thoughts?
I'd be happy to submit a PR implementing whatever you decide is the best course of action.
The text was updated successfully, but these errors were encountered: