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

chore(typing): Add explicit None return type #1915

Merged
merged 3 commits into from
Oct 9, 2023

Conversation

orsinium
Copy link
Contributor

@orsinium orsinium commented Oct 5, 2023

What does this pull request do?

If a function doesn't return anything, annotate its return type as None. It will make sure that the callee doesn't try to assign the function result to a variable.

It is recommended but not required that checked functions have annotations for all arguments and the return type. For a checked function, the default annotation for arguments and for the return type is Any.

https://peps.python.org/pep-0484/#the-meaning-of-annotations

Related issues

If a function doesn't return anything, specify its
return type as None.
@github-actions github-actions bot added agent-python community Issues opened by the community triage Issues awaiting triage labels Oct 5, 2023
Copy link
Contributor

@basepi basepi left a comment

Choose a reason for hiding this comment

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

Just one change to make black happy

elasticapm/traces.py Outdated Show resolved Hide resolved
@orsinium orsinium requested a review from basepi October 6, 2023 11:55
@basepi basepi enabled auto-merge (squash) October 9, 2023 18:10
@basepi
Copy link
Contributor

basepi commented Oct 9, 2023

@elasticmachine, run elasticsearch-ci/docs

@basepi basepi merged commit 519a107 into elastic:main Oct 9, 2023
93 of 94 checks passed
@orsinium orsinium deleted the none-return-type branch October 12, 2023 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-python community Issues opened by the community triage Issues awaiting triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants