Skip to content

More type hints #3193

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

Merged
merged 2 commits into from
Jul 27, 2020
Merged

More type hints #3193

merged 2 commits into from
Jul 27, 2020

Conversation

ciscorn
Copy link

@ciscorn ciscorn commented Jul 23, 2020

Added and corrected some type annotations.

I also tweaked extract_pyi.py a bit.

@ciscorn ciscorn force-pushed the type-annotations branch 4 times, most recently from 8b81bff to a8fdc19 Compare July 24, 2020 05:31
@ciscorn ciscorn force-pushed the type-annotations branch from a8fdc19 to 54a342a Compare July 24, 2020 09:20
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple minor things. Thank you!

@@ -10,30 +10,20 @@
//| def __init__(self) -> None:
//| """Enum-like class to define the satellite system type."""
//|
//| GPS: SatelliteSystem = ...
//| """Global Positioning System.
//| GPS: SatelliteSystem
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the = ... not needed?

Copy link
Author

@ciscorn ciscorn Jul 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's valid with = ..., but:

  • typeshed doesn’t use = … for constants and data attributes.
  • sphinx-autoapi renders = ... as '= Ellipsis' that can be confusing.
    = Ellipsis

So I think just removing them is reasonable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally agree! Is there anyway we could check that the = ... isn't added?

@ciscorn ciscorn requested a review from tannewt July 25, 2020 09:27
@ciscorn ciscorn force-pushed the type-annotations branch 8 times, most recently from b8851a7 to 0822e67 Compare July 27, 2020 08:46
@ciscorn ciscorn force-pushed the type-annotations branch from 0822e67 to d356581 Compare July 27, 2020 09:05
@dhalbert
Copy link
Collaborator

@ciscorn Let us know when you're ready for review. Thanks!

@ciscorn
Copy link
Author

ciscorn commented Jul 27, 2020

@dhalbert @tannewt It's ready for another look. Thanks.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thank you!

@tannewt tannewt merged commit 7be9837 into adafruit:main Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants