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

[py]: add type hints for method parameters #11053

Merged
merged 2 commits into from Sep 26, 2022
Merged

[py]: add type hints for method parameters #11053

merged 2 commits into from Sep 26, 2022

Conversation

plming
Copy link
Contributor

@plming plming commented Sep 23, 2022

Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it

Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.

Description

I add type hint about methods parameters on Webdriver class

Motivation and Context

I'm writing codes on Visual Studio Code and using pylance with strict type checking.
But pylance emit errors because some parameters' type is unknown.
This happens because there's no type annotations that IDE or linter uses.

Types of changes

Python's type hint doesn't affect runtimes. It's just for IDE and linter.

  • 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. ;; I didn't run tests because it's not affect runtime behaviors..

@CLAassistant
Copy link

CLAassistant commented Sep 23, 2022

CLA assistant check
All committers have signed the CLA.

@codecov-commenter
Copy link

codecov-commenter commented Sep 25, 2022

Codecov Report

Base: 52.35% // Head: 52.63% // Increases project coverage by +0.27% 🎉

Coverage data is based on head (9334a9a) compared to base (dc53093).
Patch coverage: 60.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##            trunk   #11053      +/-   ##
==========================================
+ Coverage   52.35%   52.63%   +0.27%     
==========================================
  Files          81       81              
  Lines        5388     5388              
  Branches      270      270              
==========================================
+ Hits         2821     2836      +15     
+ Misses       2297     2282      -15     
  Partials      270      270              
Impacted Files Coverage Δ
py/selenium/webdriver/remote/webdriver.py 42.71% <60.00%> (+2.91%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@titusfortner titusfortner merged commit 760305b into SeleniumHQ:trunk Sep 26, 2022
@plming plming deleted the add-py-type-hint branch September 26, 2022 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants