Explicitly mark arguments as optional
mypy now considers implicitly Optional arguments to be errors - I have made them now explicitly Optional, which passes.
This commit is contained in:
parent
ba62bdf867
commit
8e50a90fb2
3 changed files with 8 additions and 6 deletions
|
|
@ -30,7 +30,7 @@ import logging
|
|||
import time
|
||||
|
||||
# Type hinting
|
||||
from typing import BinaryIO, Tuple, Union
|
||||
from typing import BinaryIO, Tuple, Union, Optional
|
||||
|
||||
import numpy as np
|
||||
|
||||
|
|
@ -307,7 +307,7 @@ class PiCameraStreamer(BaseCamera):
|
|||
self.picamera.zoom = new_fov
|
||||
|
||||
def start_preview(
|
||||
self, fullscreen: bool = True, window: Tuple[int, int, int, int] = None
|
||||
self, fullscreen: bool = True, window: Optional[Tuple[int, int, int, int]] = None
|
||||
):
|
||||
"""Start the on board GPU camera preview."""
|
||||
with self.lock(timeout=1):
|
||||
|
|
@ -462,9 +462,9 @@ class PiCameraStreamer(BaseCamera):
|
|||
output: Union[str, BinaryIO],
|
||||
fmt: str = "jpeg",
|
||||
use_video_port: bool = False,
|
||||
resize: Tuple[int, int] = None,
|
||||
resize: Optional[Tuple[int, int]] = None,
|
||||
bayer: bool = True,
|
||||
thumbnail: Tuple[int, int, int] = None,
|
||||
thumbnail: Optional[Tuple[int, int, int]] = None,
|
||||
):
|
||||
"""
|
||||
Capture a still image to a StreamObject.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue