Add stubs for geojson#15816
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
|
Passing:
|
|
I know that the stubs are still marked as draft, but I've had a brief look. One thing I noticed is the use of If you need a placeholder for "not fully typed yet", either leave out the annotation or use def foo(x: str) -> Any: ... # returns str if x starts with "bar:", int otherwise |
|
@srittau Thanks for the quick feedback! I'll take another pass at it. Do you have any advice for typing the coordinates parameter in the geojson.geometry module? Something like Or should we overload the |
|
I haven't looked at the type, but you could try a recursive type alias. Alternatively use |
The package maintainer has made it clear that type annotations will not be added to the project: jazzband/geojson#235 (comment)
Used
scripts/create_baseline_stubs.pyto generate initial stubs and tested withtests/stubtest_third_party.py.