[py] Update docstrings style according to google guideline by iampopovich ยท Pull Request #16445 ยท SeleniumHQ/selenium
User description
๐ Related Issues
relates to #16427
๐ฅ What does this PR do?
https://github.com/google/styleguide/blob/gh-pages/pyguide.md
This pull request focuses on improving the clarity and consistency of docstrings across several Selenium WebDriver Python modules, especially for Chromium, Chrome, Edge, and Firefox classes. The changes modernize docstring formats to follow a more standardized "Args"/"Returns"/"Example" style, making the documentation easier to read and understand for both users and contributors.
Docstring Standardization and Clarification
- Updated constructor and method docstrings in
chromium/webdriver.pyandchrome/webdriver.pyto use consistent "Args" and "Returns" sections, replacing older ":Args:" and ":Returns:" formats. This includes clearer descriptions and examples for parameters and return values. [1] [2] - Improved docstrings in
chromium/options.pyfor properties and methods, ensuring each parameter and return value is clearly documented using the "Args" and "Returns" format. [1] [2] [3] [4] [5] [6] [7]
Edge-Specific Documentation Improvements
- Enhanced docstrings in
edge/options.pyandedge/service.pyto clarify initialization parameters, property purposes, and method return values, all using the updated documentation style. [1] [2] [3] [4] [5]
Other Browser-Specific Updates
- Updated the
FirefoxBinaryclass constructor infirefox/firefox_binary.pyto use the new docstring format for parameter documentation.
Minor Enhancements
- Added explicit docstrings to methods that previously lacked them, such as those raising
NotImplementedErrorinchromium/webdriver.py, to clarify their current status.
These changes collectively make the codebase's documentation more accessible and maintainable, which will help both new and experienced developers understand and use these APIs more effectively.
๐ง Implementation Notes
๐ก Additional Considerations
๐ Types of changes
- Cleanup (formatting, renaming)
PR Type
Documentation
Description
-
Standardized Python docstrings to Google style guide format
-
Updated Args/Returns/Example sections across WebDriver modules
-
Enhanced clarity for Chromium, Chrome, Edge, and Firefox classes
-
Improved parameter descriptions and usage examples
Diagram Walkthrough
flowchart LR
A["Old docstring format"] --> B["Google style format"]
B --> C["Chrome/Chromium modules"]
B --> D["Edge modules"]
B --> E["Firefox modules"]
C --> F["Improved Args/Returns"]
D --> F
E --> F
File Walkthrough
| Relevant files | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Documentation |
|