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] moved ConnectionType class outside Mobile class to avoid nesting of classes #12256

Merged
merged 2 commits into from
Jun 27, 2023

Conversation

sandeepsuryaprasad
Copy link
Contributor

… in remote/mobile.py

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 have moved ConnectionType class outside Mobile class in remote/mobile.py to avoid nesting of classes and for better readability.

Motivation and Context

The class ConnectionType is inside Mobile class, which is I felt bit confusing and hard to read. So I have moved the inner class ConnectionType out of Mobile class.

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.

@diemol
Copy link
Member

diemol commented Jun 27, 2023

It is a rather short class. Is this because the current state is not aligned with a Python style guide? I do not see what the benefit is.

@sandeepsuryaprasad
Copy link
Contributor Author

It is a rather short class. Is this because the current state is not aligned with a Python style guide? I do not see what the benefit is.

Normally we do have nested functions or classes only in case of decorators or in case of fixtures. But this is a normal class, so I have moved it out of Mobile class to keep ConnectionType object separate.

Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

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

Thank you for clarifying!

@diemol diemol merged commit 55aa885 into SeleniumHQ:trunk Jun 27, 2023
@sandeepsuryaprasad sandeepsuryaprasad deleted the mobile branch November 24, 2024 04:17
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.

2 participants