Skip to content

Conversation

@DimitriPapadopoulos
Copy link
Contributor

I am not enforcing these rules yet.

RUF003 Comment contains ambiguous ` ` (NO-BREAK SPACE). Did you mean ` ` (SPACE)?
RUF007 Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs
RUF010 Use explicit conversion flag
RUF015 Prefer `next(...)` over single element slice
RUF017 Avoid quadratic list summation
RUF046 Value being cast to `int` is already an integer
RUF051 Use `pop` instead of `key in dict` followed by `del dict[key]`
@github-actions
Copy link
Contributor

Unit Test Results

See test report for an extended history of previous test failures. This is useful for diagnosing flaky tests.

    27 files  ±0      27 suites  ±0   9h 53m 30s ⏱️ - 2m 58s
 4 112 tests ±0   4 008 ✅ +4    104 💤 ±0  0 ❌  - 4 
51 516 runs  ±0  49 332 ✅ +4  2 184 💤 ±0  0 ❌  - 4 

Results for commit 9129511. ± Comparison against base commit 0771baa.

Copy link
Member

@jacobtomlinson jacobtomlinson left a comment

Choose a reason for hiding this comment

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

There are some good readability and performance improvements in here thanks! Are you not enforcing because they require manually fixing? If they need manual work then I think we should not enforce them.

Personally I would only use next(iter(...)) in cases where performance matters as it's not so novice friendly. If we really want to get away from x = list(...)[0] we can always use [x, _*] = ... which can be easier for novices to parse than x = next(iter(...)).

I also think RUF010 reduces readability by using advanced f-string expressions. The original code was already very readable.

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