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

Include None type in hints for function params with default value None #121

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/osdatahub/LinkedIdentifiersAPI/linked_identifiers_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ def __get_endpoint(
def query(
self,
identifier: Union[int, str],
feature_type: str = None,
identifier_type: str = None,
feature_type: Union[str, None] = None,
identifier_type: Union[str, None] = None,
) -> dict:
"""Run a query of the OS Linked Identifiers API - looks up an
identifier and finds its associated identifiers.
Expand Down
2 changes: 1 addition & 1 deletion src/osdatahub/PlacesAPI/places_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __get_dataset_param(dataset: Union[str, Iterable] ) -> str:
def query(
self,
extent: Extent,
output_crs: str = None,
output_crs: Union[str, None] = None,
limit: int = 100,
classification_code: Union[str, Iterable, None] = None,
logical_status_code: Union[str, int, None] = None,
Expand Down
3 changes: 2 additions & 1 deletion src/osdatahub/bbox.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from dataclasses import astuple, dataclass
from typing import Union


@dataclass
Expand All @@ -19,7 +20,7 @@ def __iter__(self):
def __getitem__(self, index):
return list(self)[index]

def to_string(self, precision: int = None) -> str:
def to_string(self, precision: Union[int, None] = None) -> str:
"""
Converts bounding box into string

Expand Down
4 changes: 3 additions & 1 deletion src/osdatahub/grow_list.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
from typing import Union

class GrowList:
"""
GrowList is a convenience class that behaves similarly to a normal
list, except that it stores its length changes whenever it is extended
with the extend() function.
"""

def __init__(self, values: list = None):
def __init__(self, values: Union[list, None] = None):
self.values = values if values else []
self.size = [len(self.values)]

Expand Down