Skip to content

Commit

Permalink
Replace implicit optional typedefs
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Finucane <[email protected]>
  • Loading branch information
stephenfin committed Dec 6, 2022
1 parent 950b15c commit cf80c6e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions git_pw/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def _handle_error(

def _get(
url: str,
params: Filters = None,
params: ty.Optional[Filters] = None,
stream: bool = False,
) -> requests.Response:
"""Make GET request and handle errors."""
Expand Down Expand Up @@ -236,8 +236,8 @@ def version() -> ty.Tuple[int, int]:

def download(
url: str,
params: Filters = None,
output: ty.Optional[str] = None,
params: ty.Optional[Filters] = None,
output: ty.Optional[ty.Optional[str]] = None,
) -> ty.Optional[str]:
"""Retrieve a specific API resource and save it to a file/stdout.
Expand Down Expand Up @@ -293,7 +293,7 @@ def download(
return output_path


def index(resource_type: str, params: Filters = None) -> dict:
def index(resource_type: str, params: ty.Optional[Filters] = None) -> dict:
"""List API resources.
GET /{resource}/
Expand Down Expand Up @@ -322,7 +322,7 @@ def index(resource_type: str, params: Filters = None) -> dict:
def detail(
resource_type: str,
resource_id: ty.Union[str, int],
params: Filters = None,
params: ty.Optional[Filters] = None,
) -> ty.Dict:
"""Retrieve a specific API resource.
Expand Down
4 changes: 2 additions & 2 deletions git_pw/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ def _pagination_options(f):


def format_options(
original_function: ty.Callable = None,
headers: ty.Tuple[str, ...] = None,
original_function: ty.Optional[ty.Callable] = None,
headers: ty.Optional[ty.Tuple[str, ...]] = None,
) -> ty.Callable:
"""Shared output format options."""

Expand Down

0 comments on commit cf80c6e

Please sign in to comment.