Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Commit

Permalink
Fix missing return type annotations on constructors with no arguments
Browse files Browse the repository at this point in the history
As discussed in python/mypy#604, functions
with at least one argument type annotation are allowed to omit the
return type annotation, in which case it defaults to `None`. However,
functions with no arguments cannot have argument type annotations,
so the return type of `None` must be explicitly specified.
  • Loading branch information
kierdavis committed Mar 30, 2019
1 parent 329e0f7 commit 1244391
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/components/test_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class MockButtonDriver(ButtonInterface):
"""A testing driver for the button component."""

def __init__(self):
def __init__(self) -> None:
self.state = False

def set_button_state(self, new_state: bool) -> None:
Expand Down
2 changes: 1 addition & 1 deletion tests/components/test_gpio_pin.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class MockGPIOPinDriver(GPIOPinInterface):
"""A testing driver for the GPIO pin component."""

def __init__(self):
def __init__(self) -> None:

self.pin_count: int = 10
self._mode: List[GPIOPinMode] = [
Expand Down
2 changes: 1 addition & 1 deletion tests/components/test_power_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class MockPowerOutputDriver(PowerOutputInterface):
"""A testing driver for power outputs."""

def __init__(self):
def __init__(self) -> None:
self._enabled = False

def get_power_output_enabled(self, identifier: int) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class Robot(BaseRobot):
"""A robot."""

def __init__(self):
def __init__(self) -> None:
self._env = TestEnvironment


Expand Down

0 comments on commit 1244391

Please sign in to comment.