adafruit / Adafruit_CircuitPython_Typing

Definitions not in the standard `typing` module that are needed for type annotation of CircuitPython code.
MIT License
6 stars 9 forks source link

1.1.0 requires python 3.8 #3

Closed Neradoc closed 2 years ago

Neradoc commented 2 years ago

typing.Protocol and the / syntax for function arguments both require python 3.8. https://www.python.org/dev/peps/pep-0570/ https://www.python.org/dev/peps/pep-0544/

Python 3.7.3 (default, Jan 22 2021, 20:04:44) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import adafruit_mprls
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pi/temp/venv/lib/python3.7/site-packages/adafruit_mprls.py", line 37, in <module>
    from adafruit_bus_device.i2c_device import I2CDevice
  File "/home/pi/temp/venv/lib/python3.7/site-packages/adafruit_bus_device/i2c_device.py", line 13, in <module>
    from circuitpython_typing import ReadableBuffer, WriteableBuffer
  File "/home/pi/temp/venv/lib/python3.7/site-packages/circuitpython_typing/__init__.py", line 45
    def read(self, count: Optional[int] = None, /) -> Optional[bytes]:
                                                ^
SyntaxError: invalid syntax
>>>
>>> from typing import Protocol
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'Protocol' from 'typing' (/usr/lib/python3.7/typing.py)
>>>