From 935b860385a4c47cf3a8334fc258fa696c3ab369 Mon Sep 17 00:00:00 2001 From: Devan Mallory <32146940+dman82499@users.noreply.github.com> Date: Wed, 28 May 2025 00:53:21 -0400 Subject: [PATCH] Update quads.py to fix bug causing Point data to be None in QuadTree if set in the Point constructor like the example shows --- quads.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/quads.py b/quads.py index 74bec9a..1c173ba 100644 --- a/quads.py +++ b/quads.py @@ -799,7 +799,8 @@ def insert(self, point, data=None): bool: `True` if insertion succeeded, otherwise `False`. """ pnt = self.convert_to_point(point) - pnt.data = data + if pnt.data is None or data is not None: + pnt.data = data return self._root.insert(pnt) def find(self, point):