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

Optimize wait #5734

Closed
wants to merge 1 commit into from
Closed

Optimize wait #5734

wants to merge 1 commit into from

Conversation

wulei01
Copy link
Contributor

@wulei01 wulei01 commented Jul 19, 2023

1.Removed the initialization of args and kwargs in the function signature: In Python, mutable default arguments should generally be avoided because they r
tain their state across function calls. By removing the initialization, the function behaves more consistently.
2.Added type hints to the function signature: Type hints improve code readability and provide better documentation by indicating the expected types of the
function's parameters and return value.
3.Removed the unnecessary check for args and kwargs being None: Since args and kwargs are mutable by default, it's not necessary to check if they are None
before assigning empty lists or dictionaries to them.
4.Reorganized the comments and docstring: The comments and docstring have been reorganized to follow the standard Python format, which makes the code more
readable and consistent with common conventions.
5.Removed the explicit conversion of first and step to floats: The default values of first and step are already specified as floats, so there's no need fo
explicit conversion.
6.Removed the args and kwargs assignments and passed them directly to func(): This change simplifies the code by directly passing the args and kwargs to t
e func() call, eliminating the need for separate assignment statements.

Signed-off-by: wulei01 [email protected]

@mr-avocado
Copy link

mr-avocado bot commented Jul 19, 2023

Dear contributor,
Avocado is currently under sprint #103, which is due to release an LTS (Long Term Stability) release.
Please avoid merging changes that do not fall into these categories:

  • Bug fixes
  • Usability Improvements
  • Documentation updates

As for the Avocado utility modules (“avocado.utils”) it is OK to introduce new functionality,
but changes to the existing APIs (including interface and behavior) should be avoided.
These kind of changes should wait until sprint #104.

@richtja
Copy link
Contributor

richtja commented Jul 19, 2023

Hi @wulei01 thank you for your contribution, I presume this is new version of #5720. Unfortunately, right now, this is a duplicity of #5730 which doesn't change the interface of this utility. I will close this as duplicate, but if you have any comments, don't hesitate to reopen it.

@richtja richtja closed this Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants