adafruit / Adafruit_CircuitPython_PyBadger

Badge-focused CircuitPython helper library for PyBadge, PyBadge LC, PyGamer and CLUE
MIT License
21 stars 26 forks source link

Type annotation corrections needed #62

Closed tekktrik closed 1 year ago

tekktrik commented 2 years ago

This library needs type annotation improvements! It mistakenly uses Type[tuple] where there are namedtuple returns. For example:

from collections import namedtuple

NamedTupleClass = namedtuple("NamedTupleClass", ("A", "B", "C"))

Then if a function use a type annotation like Type[tuple]:

def some_method(arg_a: str, arg_b: int) -> Type[tuple]:
    return NamedTupleClass(1, 2, 3)

It should actually be:

def some_method(arg_a: str, arg_b: int) -> NamedTupleClass:
    return NamedTupleClass(1, 2, 3)
Jayaram18 commented 2 years ago

Hi @tekktrik , I would like to work on this issue.

tekktrik commented 2 years ago

Sure thing! Let me know if I can help with anything!

tekktrik commented 2 years ago

Hey @Jayaram18 anything I can help with?