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

Update UP038 docs to note that it results in slower code #7872

Merged
merged 1 commit into from
Oct 9, 2023

Conversation

AlexWaygood
Copy link
Member

See discussion in #7871. I tried to use language similar to the existing performance warnings in the flake8-use-pathlib docs, e.g. https://docs.astral.sh/ruff/rules/os-path-abspath/#os-path-abspath-pth100

/// `|`-separated union of types, which is more concise and consistent
/// `|`-separated union of types, which is consistent
Copy link
Member Author

Choose a reason for hiding this comment

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

I also changed this line, since the rule only makes code more concise if the tuple of types has exactly length 2. If the tuple is 3 elements long, the rule results in code that has exactly the same level of verbosity. If the tuple is 4 or more elements long, the rule results in code that is more verbose than it was originally.

Copy link
Member

@konstin konstin left a comment

Choose a reason for hiding this comment

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

Thanks!

@github-actions
Copy link
Contributor

github-actions bot commented Oct 9, 2023

PR Check Results

Ecosystem

✅ ecosystem check detected no changes.

@zanieb zanieb merged commit 016e162 into astral-sh:main Oct 9, 2023
16 checks passed
@zanieb zanieb added the documentation Improvements or additions to documentation label Oct 9, 2023
@AlexWaygood AlexWaygood deleted the up038-docs branch October 9, 2023 20:59
konstin pushed a commit that referenced this pull request Oct 11, 2023
See discussion in #7871. I tried to use language similar to the existing
performance warnings in the `flake8-use-pathlib` docs, e.g.
https://docs.astral.sh/ruff/rules/os-path-abspath/#os-path-abspath-pth100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants