Skip to content

Type annotations corrections needed #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tekktrik opened this issue Sep 16, 2022 · 0 comments · Fixed by #32
Closed

Type annotations corrections needed #30

tekktrik opened this issue Sep 16, 2022 · 0 comments · Fixed by #32
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers Hacktoberfest DigitalOcean's Hacktoberfest

Comments

@tekktrik
Copy link
Member

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)
@tekktrik tekktrik added documentation Improvements or additions to documentation good first issue Good for newcomers labels Sep 16, 2022
@adafruit-adabot adafruit-adabot added the Hacktoberfest DigitalOcean's Hacktoberfest label Sep 29, 2022
@jepler jepler closed this as completed in #32 Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers Hacktoberfest DigitalOcean's Hacktoberfest
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants