Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/shapefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,11 @@ def read(self, size: int = -1) -> bytes: ...

# https://en.wikipedia.org/wiki/.dbf#Database_records
class FieldType:
"""A bare bones 'enum', as the enum library noticeably slows performance."""
"""A bare bones 'enum', as the enum library used to noticeably slow performance.
A StrENum could be used instead, once the minimum supported Python
version >= 3.11. But the Public API supports passing strings into
Field (a NamedTuple which used to just be a plain tuple[str,str,int,int]).
"""

C: Final = "C" # "Character" # (str)
D: Final = "D" # "Date"
Expand Down Expand Up @@ -1106,6 +1110,7 @@ class GeoJSON_Error(Exception):
pass


# Could be an Enum, but an isinstance check is still needed.
class _NoShapeTypeSentinel:
"""An instance is the default value for Shape.__init__,
to preserve old behaviour for anyone who explictly
Expand Down Expand Up @@ -3572,6 +3577,7 @@ def iterShapes(
assert n == len(self.headers_cache), f"{n=}, {len(self.headers_cache)=}"


# Could be an enum, but an isinstance check is still needed.
class _NoShpSentinel:
"""An instance is the default value for shp to preserve the
old behaviour (from when all keyword args were gathered
Expand Down
Loading