-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[py] applied google pydoc format to @properties #16511
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
base: trunk
Are you sure you want to change the base?
[py] applied google pydoc format to @properties #16511
Conversation
…at for consistency
…sistency in WebDriver class
…sistency across options and server classes
…sistency across multiple classes
…sistency across multiple files
|
Thank you, @iampopovich for this code suggestion. The support packages contain example code that many users find helpful, but they do not necessarily represent After reviewing the change, unless it is a critical fix or a feature that is needed for Selenium We actively encourage people to add the wrapper and helper code that makes sense for them to their own frameworks. |
|
@cgoldberg check please |
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||||||||
… and find_elements methods
|
@cgoldberg sorry , my bad ,i ruined all tests with imported WebElement type in shadowroot class. I think there will be pitfalls with the implementation of type hints in #15697 🥶 |
User description
🔗 Related Issues
relates #11442
💥 What does this PR do?
This pull request refactors docstrings throughout several files in the Selenium Python codebase, specifically in the
action_builder.py,browser.py, andbrowsing_context.pymodules. The main focus is to standardize and modernize the documentation style by replacing sections like "Parameters", "Returns", and "Raises" with the more Pythonic "Args", direct return type descriptions, and clearer exception documentation. This improves readability and consistency for developers and users of the API.Docstring standardization and modernization:
Replaced "Parameters" and "Returns" sections with "Args" and direct return type descriptions in all relevant methods across
action_builder.py,browser.py, andbrowsing_context.py. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]Updated exception documentation to use "Raises" with specific exception types, improving clarity on error handling. [1] [2] [3] [4]
Minor improvements and fixes:
Overall, these changes make the codebase's documentation more uniform and accessible for both new and experienced developers.
🔧 Implementation Notes
💡 Additional Considerations
🔄 Types of changes
PR Type
Documentation
Description
Comprehensive standardization of Python docstrings across the Selenium codebase to follow Google pydoc format:
_add_interceptparameterphasesdefault from mutable empty list toNonewith runtime initializationfind_element,find_elements, andadd_file_dialog_handlermethodsExceptiontoValueError) and added exception chaining in error handlingDiagram Walkthrough
File Walkthrough
17 files
webdriver.py
Standardize docstring format to Google style guidepy/selenium/webdriver/remote/webdriver.py
Google-style "Args/Returns/Raises"
separator lines
bullet points
documentation
expected_conditions.py
Apply Google docstring format to expected conditionspy/selenium/webdriver/support/expected_conditions.py
format
webelement.py
Standardize WebElement docstrings to Google formatpy/selenium/webdriver/remote/webelement.py
separator lines
browsing_context.py
Apply Google docstring format to browsing context modulepy/selenium/webdriver/common/bidi/browsing_context.py
format
storage.py
Standardize storage module docstrings to Google formatpy/selenium/webdriver/common/bidi/storage.py
get_cookiesmethodsession.py
Apply Google docstring format to session modulepy/selenium/webdriver/common/bidi/session.py
format
statusmethod docstring for better readabilityoptions.py
Standardize IE options property docstrings to Google formatpy/selenium/webdriver/ie/options.py
"Parameters" sections with "Args"
properties
print_page_options.py
Modernize print page options docstrings to Google formatpy/selenium/webdriver/common/print_page_options.py
in Google pydoc format
set_page_sizemethod docstring with improved Args and Examplesections
options.py
Standardize base options property docstrings to Google formatpy/selenium/webdriver/common/options.py
in Google format
page_load_strategydocstring (removed leading colon)wait.py
Modernize WebDriverWait docstrings to Google pydoc formatpy/selenium/webdriver/support/wait.py
__init__docstringmethods
until_notdocstring description to accurately reflect behavioraction_builder.py
Standardize action builder docstrings to Google formatpy/selenium/webdriver/common/actions/action_builder.py
emulation.py
Standardize emulation BiDi docstrings to Google formatpy/selenium/webdriver/common/bidi/emulation.py
options.py
Simplify Safari options property docstringspy/selenium/webdriver/safari/options.py
descriptions
server.py
Standardize server class docstring to Google formatpy/selenium/webdriver/remote/server.py
webextension.py
Modernize web extension BiDi docstringspy/selenium/webdriver/common/bidi/webextension.py
permissions.py
Standardize permissions BiDi docstring formatpy/selenium/webdriver/common/bidi/permissions.py
common.py
Modernize common BiDi utility docstringpy/selenium/webdriver/common/bidi/common.py
1 files
network.py
Refactor network BiDi docstrings and fix mutable default argumentpy/selenium/webdriver/common/bidi/network.py
_add_interceptparameterphasesdefault from empty list toNonewith runtime initializationmethods
consistency
1 files
shadowroot.py
Add type hints and modernize shadow root docstringspy/selenium/webdriver/remote/shadowroot.py
find_elementandfind_elementsmethods
WebElementtype annotation1 files
browser.py
Clean up browser BiDi docstrings and improve error handlingpy/selenium/webdriver/common/bidi/browser.py
getter methods
from_dictandcreate_user_contextdocstrings to "Args"format
ExceptiontoValueErrorinremove_user_contextfrom einfrom_dicterror handling1 files
input.py
Modernize input BiDi docstrings and add type hintspy/selenium/webdriver/common/bidi/input.py
add_file_dialog_handlermethod