summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Kramkowski <tk@the-tk.com>2021-12-15 23:08:14 +0000
committerTomasz Kramkowski <tk@the-tk.com>2021-12-15 23:08:14 +0000
commit3f13e2dc6676057010ccdf57df776304e8cdef7f (patch)
treefa4f2d1657d900e099dfe91bfe3ceeca6f6a9f18
parent1d30fd93e2b18b10c75638bfd27811244371d2f2 (diff)
downloadaoc2021-typing-madness.tar.gz
aoc2021-typing-madness.tar.xz
aoc2021-typing-madness.zip
wip3: eh, good enoughtyping-madness
-rw-r--r--utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/utils.py b/utils.py
index 607d9d8..00d0d60 100644
--- a/utils.py
+++ b/utils.py
@@ -44,7 +44,7 @@ def inbounds(p: Point2D[NumT], a: Point2D[NumT], _b: Optional[Point2D[NumT]] = N
b = _b
else:
b = a
- a = cast(Point2D[NumT], Point2D(0, 0))
+ a = cast(Point2D[NumT], Point2D(0, 0) if isinstance(a.x, int) else Point2D(0.0, 0.0))
return p.x >= a.x and p.y >= a.y and p.x < b.x and p.y < b.y
def adjacent(p: Point2D[int], diagonal: bool = True) -> Iterator[Point2D[int]]: