Skip to content

Commit

Permalink
Try #168:
Browse files Browse the repository at this point in the history
  • Loading branch information
bors[bot] committed Jun 6, 2019
2 parents 5bdcb0e + 1eca758 commit 67f8c9f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ppb_vector/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ class Vector:
x: float
y: float

# Class-level attributes
zero: typing.ClassVar['Vector']

# Tell CPython that this isn't an extendable dict
__slots__ = ('x', 'y', '__weakref__')

Expand Down Expand Up @@ -533,4 +536,7 @@ def reflect(self, surface_normal: VectorLike) -> 'Vector':
return self - (2 * (self * surface_normal) * surface_normal)


Vector.zero = Vector(0, 0)


Sequence.register(Vector)
5 changes: 5 additions & 0 deletions tests/test_zero.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from ppb_vector import Vector


def test_zero():
assert not Vector.zero

0 comments on commit 67f8c9f

Please sign in to comment.