Skip to content

Commit

Permalink
clarify use of dataclass
Browse files Browse the repository at this point in the history
  • Loading branch information
kopp committed Dec 24, 2021
1 parent d4d28ba commit d66a0a4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ The `astar` library only requires the following property from these objects:
For the default implementation of `is_goal_reached`, the objects must be
comparable for same-ness (i.e. implement `__eq__`).

A simple way to achieve this, is to use
A simple way to achieve this, is to use simple objects based on strings,
floats, integers, tuples.
[`dataclass`](https://docs.python.org/3/library/dataclasses.html#dataclasses.dataclass)
objects as nodes.
objects declared with `@dataclass(frozen=True)` directly implement `__hash__`
if possible.


neighbors
Expand Down

0 comments on commit d66a0a4

Please sign in to comment.