Skip to content

Commit

Permalink
Refactor __geo_interface__ to use property
Browse files Browse the repository at this point in the history
  • Loading branch information
cleder committed Dec 9, 2023
1 parent 68bd251 commit 970e016
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pygeoif/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,17 @@ class GeoFeatureCollectionInterface(TypedDict):
class GeoType(Protocol):
"""Any compatible type that implements the __geo_interface__."""

__geo_interface__: GeoInterface
@property
def __geo_interface__(self) -> GeoInterface:
"""Return the GeoInterface."""


class GeoCollectionType(Protocol):
"""Any compatible type that implements the __geo_interface__."""

__geo_interface__: GeoCollectionInterface
@property
def __geo_interface__(self) -> GeoCollectionInterface:
"""Return the GeoInterface."""


__all__ = [
Expand Down

0 comments on commit 970e016

Please sign in to comment.