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

Types: Fix PEP 484 implicit-optional compliance #1297

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

akx
Copy link
Contributor

@akx akx commented Jan 31, 2024

This was done automatically with hauntsaninja/no_implicit_optional.

This will help avoid bugs such as the one fixed by #1295, since possibly-None values are marked as such by the type annotations.

This was done automatically with hauntsaninja/no_implicit_optional.
Copy link
Contributor

@younesbelkada younesbelkada left a comment

Choose a reason for hiding this comment

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

Great catch @akx ! Any pointers on how we could test that through a CI workflow?

@younesbelkada
Copy link
Contributor

Really appreciate your recent contributions (e.g. bitsandbytes) thanks a lot @akx !

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@younesbelkada younesbelkada merged commit 88685f2 into huggingface:main Jan 31, 2024
9 checks passed
@akx
Copy link
Contributor Author

akx commented Jan 31, 2024

Great catch @akx ! Any pointers on how we could test that through a CI workflow?

Ruff can quickly catch simple mistakes (these included).

Mypy and Pyright are more fully-fledged type checkers which take more time and can be annoyingly strict in certain cases.

lapp0 pushed a commit to lapp0/trl that referenced this pull request May 10, 2024
This was done automatically with hauntsaninja/no_implicit_optional.
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