Skip to content

Commit

Permalink
README: Bring back dunder operators (Sphinx doesn't render them)
Browse files Browse the repository at this point in the history
  • Loading branch information
nbraud committed Mar 23, 2019
1 parent 08bde42 commit f9260e4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,23 @@ vector-like objects such as `tuple`, `list`, and `dict`.
Vector2(4.0, 6.0)


### Addition

>>> Vector2(1, 0) + (0, 1)
Vector2(1.0, 1.0)

### Subtraction

>>> Vector2(3, 3) - (1, 1)
Vector2(2.0, 2.0)

### Equality

Vectors are equal if their coordinates are equal.

>>> Vector2(1, 0) == (0, 1)
False

### Scalar Multiplication

Multiply a `Vector2` by a scalar to get a scaled `Vector2`:
Expand Down

0 comments on commit f9260e4

Please sign in to comment.