@@ -238,24 +238,7 @@ def __len__(self) -> int:
238
238
return self ._bitlength
239
239
240
240
241
- if typing .TYPE_CHECKING or sys .version_info >= (3 , 6 ):
242
- _PointBase = typing .Tuple [float , float ]
243
- _BoxBase = typing .Tuple ['Point' , 'Point' ]
244
- _LineBase = typing .Tuple [float , float , float ]
245
- _LineSegmentBase = typing .Tuple ['Point' , 'Point' ]
246
- _CircleBase = typing .Tuple ['Point' , float ]
247
- else :
248
- # In Python 3.5, subclassing from typing.Tuple does not make the
249
- # subclass act like a tuple in certain situations (like starred
250
- # expressions)
251
- _PointBase = tuple
252
- _BoxBase = tuple
253
- _LineBase = tuple
254
- _LineSegmentBase = tuple
255
- _CircleBase = tuple
256
-
257
-
258
- class Point (_PointBase ):
241
+ class Point (typing .Tuple [float , float ]):
259
242
"""Immutable representation of PostgreSQL `point` type."""
260
243
261
244
__slots__ = ()
@@ -290,7 +273,7 @@ def y(self) -> float:
290
273
return self [1 ]
291
274
292
275
293
- class Box (_BoxBase ):
276
+ class Box (typing . Tuple [ Point , Point ] ):
294
277
"""Immutable representation of PostgreSQL `box` type."""
295
278
296
279
__slots__ = ()
@@ -317,7 +300,7 @@ def low(self) -> Point:
317
300
return self [1 ]
318
301
319
302
320
- class Line (_LineBase ):
303
+ class Line (typing . Tuple [ float , float , float ] ):
321
304
"""Immutable representation of PostgreSQL `line` type."""
322
305
323
306
__slots__ = ()
@@ -338,7 +321,7 @@ def C(self) -> float:
338
321
return self [2 ]
339
322
340
323
341
- class LineSegment (_LineSegmentBase ):
324
+ class LineSegment (typing . Tuple [ Point , Point ] ):
342
325
"""Immutable representation of PostgreSQL `lseg` type."""
343
326
344
327
__slots__ = ()
@@ -421,7 +404,7 @@ def __init__(self, *points: typing.Sequence[float]) -> None:
421
404
super ().__init__ (* points , is_closed = True )
422
405
423
406
424
- class Circle (_CircleBase ):
407
+ class Circle (typing . Tuple [ Point , float ] ):
425
408
"""Immutable representation of PostgreSQL `circle` type."""
426
409
427
410
__slots__ = ()
0 commit comments