From 611b5564990f372a88db32128ef7bca68fa5ef2c Mon Sep 17 00:00:00 2001
From: Jan Petykiewicz <jan@mpxd.net>
Date: Thu, 24 Apr 2025 23:19:40 -0700
Subject: [PATCH] [shapes] Don't create empty dicts for annotations

---
 masque/shapes/arc.py     | 6 +++---
 masque/shapes/circle.py  | 6 +++---
 masque/shapes/ellipse.py | 6 +++---
 masque/shapes/path.py    | 6 +++---
 masque/shapes/polygon.py | 6 +++---
 masque/shapes/text.py    | 6 +++---
 6 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/masque/shapes/arc.py b/masque/shapes/arc.py
index f3f4e1e..9fe8b31 100644
--- a/masque/shapes/arc.py
+++ b/masque/shapes/arc.py
@@ -157,7 +157,7 @@ class Arc(Shape):
             offset: ArrayLike = (0.0, 0.0),
             rotation: float = 0,
             repetition: Repetition | None = None,
-            annotations: annotations_t | None = None,
+            annotations: annotations_t = None,
             raw: bool = False,
             ) -> None:
         if raw:
@@ -170,7 +170,7 @@ class Arc(Shape):
             self._offset = offset
             self._rotation = rotation
             self._repetition = repetition
-            self._annotations = annotations if annotations is not None else {}
+            self._annotations = annotations
         else:
             self.radii = radii
             self.angles = angles
@@ -178,7 +178,7 @@ class Arc(Shape):
             self.offset = offset
             self.rotation = rotation
             self.repetition = repetition
-            self.annotations = annotations if annotations is not None else {}
+            self.annotations = annotations
 
     def __deepcopy__(self, memo: dict | None = None) -> 'Arc':
         memo = {} if memo is None else memo
diff --git a/masque/shapes/circle.py b/masque/shapes/circle.py
index 2d403b4..1e49053 100644
--- a/masque/shapes/circle.py
+++ b/masque/shapes/circle.py
@@ -48,7 +48,7 @@ class Circle(Shape):
             *,
             offset: ArrayLike = (0.0, 0.0),
             repetition: Repetition | None = None,
-            annotations: annotations_t | None = None,
+            annotations: annotations_t = None,
             raw: bool = False,
             ) -> None:
         if raw:
@@ -56,12 +56,12 @@ class Circle(Shape):
             self._radius = radius
             self._offset = offset
             self._repetition = repetition
-            self._annotations = annotations if annotations is not None else {}
+            self._annotations = annotations
         else:
             self.radius = radius
             self.offset = offset
             self.repetition = repetition
-            self.annotations = annotations if annotations is not None else {}
+            self.annotations = annotations
 
     def __deepcopy__(self, memo: dict | None = None) -> 'Circle':
         memo = {} if memo is None else memo
diff --git a/masque/shapes/ellipse.py b/masque/shapes/ellipse.py
index 0d6a6c5..56ee73f 100644
--- a/masque/shapes/ellipse.py
+++ b/masque/shapes/ellipse.py
@@ -93,7 +93,7 @@ class Ellipse(Shape):
             offset: ArrayLike = (0.0, 0.0),
             rotation: float = 0,
             repetition: Repetition | None = None,
-            annotations: annotations_t | None = None,
+            annotations: annotations_t = None,
             raw: bool = False,
             ) -> None:
         if raw:
@@ -103,13 +103,13 @@ class Ellipse(Shape):
             self._offset = offset
             self._rotation = rotation
             self._repetition = repetition
-            self._annotations = annotations if annotations is not None else {}
+            self._annotations = annotations
         else:
             self.radii = radii
             self.offset = offset
             self.rotation = rotation
             self.repetition = repetition
-            self.annotations = annotations if annotations is not None else {}
+            self.annotations = annotations
 
     def __deepcopy__(self, memo: dict | None = None) -> Self:
         memo = {} if memo is None else memo
diff --git a/masque/shapes/path.py b/masque/shapes/path.py
index 93e85ea..700f02f 100644
--- a/masque/shapes/path.py
+++ b/masque/shapes/path.py
@@ -170,7 +170,7 @@ class Path(Shape):
             offset: ArrayLike = (0.0, 0.0),
             rotation: float = 0,
             repetition: Repetition | None = None,
-            annotations: annotations_t | None = None,
+            annotations: annotations_t = None,
             raw: bool = False,
             ) -> None:
         self._cap_extensions = None     # Since .cap setter might access it
@@ -182,7 +182,7 @@ class Path(Shape):
             self._vertices = vertices
             self._offset = offset
             self._repetition = repetition
-            self._annotations = annotations if annotations is not None else {}
+            self._annotations = annotations
             self._width = width
             self._cap = cap
             self._cap_extensions = cap_extensions
@@ -190,7 +190,7 @@ class Path(Shape):
             self.vertices = vertices
             self.offset = offset
             self.repetition = repetition
-            self.annotations = annotations if annotations is not None else {}
+            self.annotations = annotations
             self.width = width
             self.cap = cap
             self.cap_extensions = cap_extensions
diff --git a/masque/shapes/polygon.py b/masque/shapes/polygon.py
index 2976271..9c228d4 100644
--- a/masque/shapes/polygon.py
+++ b/masque/shapes/polygon.py
@@ -92,7 +92,7 @@ class Polygon(Shape):
             offset: ArrayLike = (0.0, 0.0),
             rotation: float = 0.0,
             repetition: Repetition | None = None,
-            annotations: annotations_t | None = None,
+            annotations: annotations_t = None,
             raw: bool = False,
             ) -> None:
         if raw:
@@ -101,12 +101,12 @@ class Polygon(Shape):
             self._vertices = vertices
             self._offset = offset
             self._repetition = repetition
-            self._annotations = annotations if annotations is not None else {}
+            self._annotations = annotations
         else:
             self.vertices = vertices
             self.offset = offset
             self.repetition = repetition
-            self.annotations = annotations if annotations is not None else {}
+            self.annotations = annotations
         if rotation:
             self.rotate(rotation)
 
diff --git a/masque/shapes/text.py b/masque/shapes/text.py
index 69318ac..e8b97ed 100644
--- a/masque/shapes/text.py
+++ b/masque/shapes/text.py
@@ -71,7 +71,7 @@ class Text(RotatableImpl, Shape):
             offset: ArrayLike = (0.0, 0.0),
             rotation: float = 0.0,
             repetition: Repetition | None = None,
-            annotations: annotations_t | None = None,
+            annotations: annotations_t = None,
             raw: bool = False,
             ) -> None:
         if raw:
@@ -81,14 +81,14 @@ class Text(RotatableImpl, Shape):
             self._height = height
             self._rotation = rotation
             self._repetition = repetition
-            self._annotations = annotations if annotations is not None else {}
+            self._annotations = annotations
         else:
             self.offset = offset
             self.string = string
             self.height = height
             self.rotation = rotation
             self.repetition = repetition
-            self.annotations = annotations if annotations is not None else {}
+            self.annotations = annotations
         self.font_path = font_path
 
     def __deepcopy__(self, memo: dict | None = None) -> Self: