Skip to content

Commit 33b3473

Browse files
committed
src - Add type hints
1 parent 8bbff40 commit 33b3473

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

overpy/format/geojson.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import json
2+
from typing import Optional, TextIO
23

34
import overpy
45

56

6-
def dump(result, fp, nodes=False, ways=False, json_args=None):
7+
def dump(result: overpy.Result, fp: TextIO, nodes: bool = False, ways: bool = False, json_args: Optional[dict] = None):
78
"""
89
Use the result from the Overpass API to generate GeoJSON.
910
@@ -12,14 +13,10 @@ def dump(result, fp, nodes=False, ways=False, json_args=None):
1213
* http://geojson.org/
1314
1415
:param result: The result from the Overpass API
15-
:type result: overpy.Result
1616
:param fp: Filepointer to use
1717
:param nodes: Export nodes
18-
:type nodes: bool
1918
:param ways: Export ways
20-
:type ways: bool
2119
:param json_args: Additional arguments passed to json.dump(...)
22-
:type json_args: dict
2320
:return:
2421
"""
2522
features = []

overpy/format/osm_xml.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
from typing import TextIO
12
from xml.sax.saxutils import escape
23

34
import overpy
45

56

6-
def dump(result, fp):
7+
def dump(result: overpy.Result, fp: TextIO):
78
"""
89
Use the result from the Overpass API to generate OSM XML
910
@@ -12,7 +13,6 @@ def dump(result, fp):
1213
* http://wiki.openstreetmap.org/wiki/OSM_XML
1314
1415
:param result: The result from the Overpass API
15-
:type result: overpy.Result
1616
:param fp: Filepointer to use
1717
:return:
1818
"""

0 commit comments

Comments
 (0)