tkrajina / gpxpy

gpx-py is a python GPX parser. GPX (GPS eXchange Format) is an XML based file format for GPS tracks.
Apache License 2.0
1.01k stars 223 forks source link

Use type alias for dict #265

Open ThomasKalverda opened 11 months ago

ThomasKalverda commented 11 months ago

Fixes TypeError on python <3.9

  ...
    import gpxpy
  File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/gpxpy/__init__.py", line 17, in <module>
    from . import gpx as mod_gpx
  File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/gpxpy/gpx.py", line 27, in <module>
    from . import gpxfield as mod_gpxfield
  File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/gpxpy/gpxfield.py", line 36, in <module>
    class SimpleTZ(mod_datetime.tzinfo):
  File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/gpxpy/gpxfield.py", line 70, in SimpleTZ
    def __deepcopy__(self, memodict: Optional[dict[Any, Any]]={}) -> mod_datetime.tzinfo:
TypeError: 'type' object is not subscriptable

Fixes #266