Skip to content

Conversation

@davetapley
Copy link
Contributor

@davetapley davetapley commented Jun 1, 2023

Before:
Screen Shot 2023-06-01 at 11 00 36 AM

After:
Screen Shot 2023-06-01 at 11 01 06 AM

#97

This is sufficient for Pyright to infer the complete return type for (at least) nwis.get_info and nwis.get_iv.

DOI-USGS#97
@elbeejay
Copy link
Contributor

elbeejay commented Jun 5, 2023

I'm fine with this type of type hinting, thank you for also providing those screenshots @davetapley, helps me understand where this is helpful -- otherwise I'd have likely asked why this is more useful than the typing specified in the doc-string immediately below the function.

What do you think @thodson-usgs ?

Copy link
Collaborator

@thodson-usgs thodson-usgs left a comment

Choose a reason for hiding this comment

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

Yes, I'd accept type-hinting PR's, though we should encourage a standard style.

I don't see it causing a problem in this case, but eventually we may need to modify the import section in order for type hinting work with our build process. The details are hazy, but I'll fix it when that occurs.

@thodson-usgs
Copy link
Collaborator

Primarily, type-hinting makes the linter aware of what objects are.

Co-authored-by: Timothy Hodson <[email protected]>
@thodson-usgs thodson-usgs merged commit 37f4190 into DOI-USGS:master Jun 6, 2023
@davetapley davetapley mentioned this pull request Sep 20, 2023
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