Skip to content

Commit d2df1ef

Browse files
committed
use annotations and TYPE_CHECKING
.. and eliminate imports no longer used since the change to the acceleration property
1 parent 998e0f9 commit d2df1ef

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

adafruit_pybadger/pybadger_base.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
2828
"""
2929

30+
from __future__ import annotations
31+
32+
3033
import time
3134
import array
3235
import math
@@ -55,16 +58,17 @@
5558
pass
5659

5760
try:
61+
from typing import TYPE_CHECKING
62+
except ImportError:
63+
TYPE_CHECKING = const(0)
64+
65+
if TYPE_CHECKING:
5866
from typing import Union, Tuple, Optional, Generator
5967
from adafruit_bitmap_font.bdf import BDF # pylint: disable=ungrouped-imports
6068
from adafruit_bitmap_font.pcf import PCF # pylint: disable=ungrouped-imports
6169
from fontio import BuiltinFont
6270
from keypad import Keys, ShiftRegisterKeys
6371
from neopixel import NeoPixel
64-
from adafruit_lsm6ds.lsm6ds33 import LSM6DS33
65-
from adafruit_lis3dh import LIS3DH_I2C
66-
except ImportError:
67-
pass
6872

6973

7074
__version__ = "0.0.0-auto.0"

0 commit comments

Comments
 (0)