Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shapely stubs for CoordinateSequence do not cover 2.5D case #13422

Closed
kveretennicov opened this issue Jan 21, 2025 · 1 comment · Fixed by #13435
Closed

Shapely stubs for CoordinateSequence do not cover 2.5D case #13422

kveretennicov opened this issue Jan 21, 2025 · 1 comment · Fixed by #13435
Labels
stubs: false positive Type checkers report false errors

Comments

@kveretennicov
Copy link

kveretennicov commented Jan 21, 2025

Shapely allows coordinates, such as Point or LineString vertices, to be either 2-part (x, y) or 3-part (x, y, z).

Thus the following code is valid:

linestring = LineString([(1, 2, 3), (4, 5, 6)])
...
for x, y, z in linestring.coords:
  ...

Shapely stubs, however, only cover 2-part coordinates. So the code above does not type check and complains about trying to unpack a 2-tuple into 3 items. This makes the stubs unusable for projects that heavily rely on 3-part coordinates.

@srittau srittau added the stubs: false positive Type checkers report false errors label Jan 22, 2025
@srittau
Copy link
Collaborator

srittau commented Jan 22, 2025

Any stub improvements are welcome!

hamdanal added a commit to hamdanal/typeshed that referenced this issue Jan 25, 2025
hamdanal added a commit to hamdanal/typeshed that referenced this issue Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stubs: false positive Type checkers report false errors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants