Skip to content

Commit b49712d

Browse files
committed
doc(mypy): replace List with Sequence
1 parent e8464d7 commit b49712d

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

adafruit_hid/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
# imports
2121
try:
22-
from typing import List
22+
from typing import Sequence
2323
import usb_hid
2424
except ImportError:
2525
pass
@@ -29,10 +29,10 @@
2929

3030

3131
def find_device(
32-
devices: List[usb_hid.device], *, usage_page: int, usage: int
32+
devices: Sequence[usb_hid.device], *, usage_page: int, usage: int
3333
) -> usb_hid.device:
34-
"""Search through the provided list of devices to find the one with the matching usage_page and
35-
usage."""
34+
"""Search through the provided sequence of devices to find the one with the matching
35+
usage_page and usage."""
3636
if hasattr(devices, "send_report"):
3737
devices = [devices]
3838
for device in devices:

adafruit_hid/consumer_control.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from . import find_device
2323

2424
try:
25-
from typing import List
25+
from typing import Sequence
2626
import usb_hid
2727
except ImportError:
2828
pass
@@ -31,10 +31,10 @@
3131
class ConsumerControl:
3232
"""Send ConsumerControl code reports, used by multimedia keyboards, remote controls, etc."""
3333

34-
def __init__(self, devices: List[usb_hid.device]) -> None:
34+
def __init__(self, devices: Sequence[usb_hid.device]) -> None:
3535
"""Create a ConsumerControl object that will send Consumer Control Device HID reports.
3636
37-
Devices can be a list of devices that includes a Consumer Control device or a CC device
37+
Devices can be a sequence of devices that includes a Consumer Control device or a CC device
3838
itself. A device is any object that implements ``send_report()``, ``usage_page`` and
3939
``usage``.
4040
"""

adafruit_hid/keyboard.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from . import find_device
1818

1919
try:
20-
from typing import List
20+
from typing import Sequence
2121
import usb_hid
2222
except ImportError:
2323
pass
@@ -39,10 +39,10 @@ class Keyboard:
3939

4040
# No more than _MAX_KEYPRESSES regular keys may be pressed at once.
4141

42-
def __init__(self, devices: List[usb_hid.device]) -> None:
42+
def __init__(self, devices: Sequence[usb_hid.device]) -> None:
4343
"""Create a Keyboard object that will send keyboard HID reports.
4444
45-
Devices can be a list of devices that includes a keyboard device or a keyboard device
45+
Devices can be a sequence of devices that includes a keyboard device or a keyboard device
4646
itself. A device is any object that implements ``send_report()``, ``usage_page`` and
4747
``usage``.
4848
"""

adafruit_hid/keyboard_layout_us.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
from .keycode import Keycode
1313

1414
try:
15-
from typing import Tuple
1615
import Keyboard
16+
from typing import Tuple
1717
except ImportError:
1818
pass
1919

adafruit_hid/mouse.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from . import find_device
1414

1515
try:
16-
from typing import List
16+
from typing import Sequence
1717
import usb_hid
1818
except ImportError:
1919
pass
@@ -29,10 +29,10 @@ class Mouse:
2929
MIDDLE_BUTTON = 4
3030
"""Middle mouse button."""
3131

32-
def __init__(self, devices: List[usb_hid.device]):
32+
def __init__(self, devices: Sequence[usb_hid.device]):
3333
"""Create a Mouse object that will send USB mouse HID reports.
3434
35-
Devices can be a list of devices that includes a keyboard device or a keyboard device
35+
Devices can be a sequence of devices that includes a keyboard device or a keyboard device
3636
itself. A device is any object that implements ``send_report()``, ``usage_page`` and
3737
``usage``.
3838
"""

0 commit comments

Comments
 (0)