Anders Kaseorg

Results 389 comments of Anders Kaseorg

Somewhat tangentially, I bet replacing `enabled: BTreeSet` with a flat array `enabled: [bool; 173]` (or some bit-set library) would speed up these checks.

Maybe we just want to apply a non-conflicting subset of the fixes, then repeatedly rerun the entire linter on the file until it converges? I doubt we’re ever going to...

This doesn’t catch `mode` as a keyword argument like pyupgrade does: ```python open("foo", mode="U") open(name="foo", mode="U") open(mode="U", name="foo") ```

We’re familiar with PEP 343, yes. This is an implementation challenge, not a conceptual challenge. (Learning how to catch exceptions was the conceptual challenge.) There’s a not-quite-working attempt to support...

This is part of Python 3 support, already filed as #70. This functionality doesn’t exist in Python 2.

What input are you passing and what error did you get? Are you using the web interface or running it locally?

Thanks for looking at this. Sequencing subsequent statements is the purpose of the `{after}` template parameter used by all the existing statement translators (except the terminating statements `break`, `continue`, `raise`,...

I’m explaining our reasons to avoid AST-level rewriting, yes. Perhaps things would be different if `symtable` worked on AST input—though even without such external considerations, I find it better to...

@mitchellrj Not quite, both because we don’t use the real `locals()` and because `*` must only give you [public names](https://docs.python.org/2.7/reference/simple_stmts.html#the-import-statement) from the module.

pyupgrade refuses to change this, since it gives false positives on things like `gzip.open` (#1026). With #1027, ruff ≥ 0.0.156 also refuses to change this.