Skip to content

Commit 7a895ce

Browse files
committed
Type hint signed_area
1 parent d199fa3 commit 7a895ce

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

shapefile.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import tempfile
1818
import time
1919
import zipfile
20+
from collections.abc import Collection
2021
from datetime import date
2122
from struct import Struct, calcsize, error, pack, unpack
2223
from typing import Any, Iterable, Iterator, Optional, Union
@@ -148,7 +149,16 @@ def __repr__(self):
148149
return str(self.tolist())
149150

150151

151-
def signed_area(coords, fast=False):
152+
def signed_area(
153+
coords: Collection[
154+
Union[
155+
tuple[float, float],
156+
tuple[float, float, float],
157+
tuple[float, float, float, float],
158+
]
159+
],
160+
fast: bool = False,
161+
) -> float:
152162
"""Return the signed area enclosed by a ring using the linear time
153163
algorithm. A value >= 0 indicates a counter-clockwise oriented ring.
154164
A faster version is possible by setting 'fast' to True, which returns

0 commit comments

Comments
 (0)