Skip to content

Fixed incorrect use of NoReturn type-hint for Python.#10120

Merged
titusfortner merged 1 commit intoSeleniumHQ:trunkfrom
cpburnz:patch-1
Dec 24, 2021
Merged

Fixed incorrect use of NoReturn type-hint for Python.#10120
titusfortner merged 1 commit intoSeleniumHQ:trunkfrom
cpburnz:patch-1

Conversation

@cpburnz
Copy link
Copy Markdown
Contributor

@cpburnz cpburnz commented Dec 8, 2021

Fixed incorrect use of NoReturn type-hint for Python.

Description

The NoReturn type-hint in Python indicates the function never returns (e.g., it always raises an exception). These methods are incorrectly marked as NoReturn when they in fact either return no value (None) or raise an exception on error. These should be hinted using None.

Motivation and Context

It fixes some incorrect type-hints.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

The [NoReturn](https://docs.python.org/3/library/typing.html#typing.NoReturn) type-hint in Python indicates the function never returns (e.g., it always raises an exception). These methods are incorrectly marked as `NoReturn` when they in fact return no value (`None`), and should by hinted using `None`.
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Dec 8, 2021

CLA assistant check
All committers have signed the CLA.

colons added a commit to colons/selenium that referenced this pull request Dec 21, 2021
This is an extension of what was done in SeleniumHQ#10120.
@titusfortner titusfortner merged commit 41a34df into SeleniumHQ:trunk Dec 24, 2021
elgatov pushed a commit to elgatov/selenium that referenced this pull request Jun 27, 2022
The [NoReturn](https://docs.python.org/3/library/typing.html#typing.NoReturn) type-hint in Python indicates the function never returns (e.g., it always raises an exception). These methods are incorrectly marked as `NoReturn` when they in fact return no value (`None`), and should by hinted using `None`.
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