Skip to content

Commit

Permalink
Include None type in hints for function params with default value None
Browse files Browse the repository at this point in the history
  • Loading branch information
aricooperdavis committed Jan 17, 2025
1 parent 10cc04a commit e0a6818
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
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

0 comments on commit e0a6818

Please sign in to comment.