Skip to content

Commit dac08eb

Browse files
committed
Add __slots__ entries.
1 parent 13f133f commit dac08eb

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10785,7 +10785,7 @@ def __del__(self):
1078510785

1078610786
del Point
1078710787
class Point:
10788-
10788+
__slots__ = ("x", "y")
1078910789
def __abs__(self):
1079010790
return math.sqrt(self.x * self.x + self.y * self.y)
1079110791

@@ -10972,7 +10972,7 @@ def unit(self):
1097210972

1097310973

1097410974
class Quad:
10975-
10975+
__slots__ = ("ul", "ur", "ll", "lr")
1097610976
def __abs__(self):
1097710977
if self.is_empty:
1097810978
return 0.0
@@ -11036,6 +11036,7 @@ def __init__(self, *args, ul=None, ur=None, ll=None, lr=None):
1103611036
None.
1103711037

1103811038
'''
11039+
1103911040
if not args:
1104011041
self.ul = self.ur = self.ll = self.lr = Point()
1104111042
elif len(args) > 4:
@@ -11204,7 +11205,7 @@ def transform(self, m):
1120411205

1120511206

1120611207
class Rect:
11207-
11208+
__slots__ = ("x0", "y0", "x1", "y1")
1120811209
def __abs__(self):
1120911210
if self.is_empty or self.is_infinite:
1121011211
return 0.0
@@ -12647,7 +12648,7 @@ class IRect:
1264712648
IRect(top-left, bottom-right) - 2 points
1264812649
IRect(sequ) - new from sequence or rect-like
1264912650
"""
12650-
12651+
__slots__ = ("x0", "y0", "x1", "y1")
1265112652
def __add__(self, p):
1265212653
return Rect.__add__(self, p).round()
1265312654

0 commit comments

Comments
 (0)