Skip to content
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

Type hints from the future #592

Merged
merged 8 commits into from
Aug 23, 2023
Merged

Type hints from the future #592

merged 8 commits into from
Aug 23, 2023

Conversation

ecomodeller
Copy link
Member

@ecomodeller ecomodeller commented Aug 10, 2023

This line enables the union type hint syntax from 3.10 to be used in 3.7+

from __future__ import annotations

I.e.

We can replace

def foo(Union[int,str]) -> Union[int,bool):
  ...

with the version that is easier to read for humans🙂

def foo(int | str) -> int | bool
  ...

@ecomodeller
Copy link
Member Author

And remove some deprecated things, mainly the aggregation on Dataset, which now consistently returns a new Dataset, which should be helpful for auto-completion.

@ecomodeller ecomodeller marked this pull request as ready for review August 11, 2023 10:07
@ecomodeller ecomodeller merged commit 61cff24 into main Aug 23, 2023
5 checks passed
@ecomodeller ecomodeller deleted the annotations branch August 23, 2023 08:19
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.

1 participant