Skip to content

[py] moved ConnectionType class outside Mobile class to avoid nesting of classes - #12256

Merged
diemol merged 2 commits into
SeleniumHQ:trunkfrom
sandeepsuryaprasad:mobile
Jun 27, 2023
Merged

[py] moved ConnectionType class outside Mobile class to avoid nesting of classes#12256
diemol merged 2 commits into
SeleniumHQ:trunkfrom
sandeepsuryaprasad:mobile

Conversation

@sandeepsuryaprasad

Copy link
Copy Markdown
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

diemol commented Jun 27, 2023

Copy link
Copy Markdown
Member

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
Copy Markdown
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.

@diemol diemol left a comment

Copy link
Copy Markdown
Member

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