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

Use __future__.annotations module #914

Merged
merged 2 commits into from
Dec 2, 2024

Conversation

jku
Copy link
Collaborator

@jku jku commented Nov 29, 2024

The extra import is a little annoying but allows using even python 3.10 annotation features already, which I like.

  • start using "X | None" instead of Optional[X]
  • Drop the quotes from factory function return values

This also keeps us compatible with python 3.8 for the moment.

@jku jku changed the title Use __future.annotations module Use __future__.annotations module Nov 29, 2024
This allows us to use even python 3.10 annotation features
already.
* start using "X | None" instead of Optional[X]
* Drop the quotes from factory function return values

This also keeps us compatible with python 3.8 for now.

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
@jku jku force-pushed the use-future-annotations branch from fffb1c0 to c6fe086 Compare November 29, 2024 09:44
@jku jku requested a review from adityasaky November 29, 2024 09:49
@jku
Copy link
Collaborator Author

jku commented Nov 29, 2024

Not quite sure who is available for review: flagged @adityasaky but no problem if you're not available

@jku

This comment was marked as outdated.

We are still compatible with 3.8: let's not be the first ones to
drop compatibility.

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
Copy link
Member

@adityasaky adityasaky left a comment

Choose a reason for hiding this comment

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

This looks good to me though I must note I may not qualify as an "expert reviewer" in python's type hints.

Also, is support for 3.8 a requirement somewhere?

@jku
Copy link
Collaborator Author

jku commented Nov 30, 2024

Also, is support for 3.8 a requirement somewhere?

No, and I would even say it's not supported: I just don't want to be the first one to explicitly break potential 3.8 users if it's easy to avoid.

@jku jku merged commit ec8d45c into secure-systems-lab:main Dec 2, 2024
16 checks passed
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.

2 participants