6 ms·
I'm a big fan but be careful, Ruff doesn't support current versions of python >=3.11 yet. Instead of direct python parsing ruff uses RustPython, that is still l
by bobuk 4y ago
I'm a big fan but be careful, Ruff doesn't support current versions of python >=3.11 yet.
Instead of direct python parsing ruff uses RustPython, that is still lack of match operator support and other modern 3.10+ stuff. If you're ok with that - go ahead and switch to ruff, you will never get back.
- gen220 4y agoOn their page, they claim "Python 3.11 compatibility" – perhaps they've added it since you formed your impression, or is this "compatibility" word misleading?
- mkesper 4y agoThe Readme mentions 3.11 compatibility so that's astonishing.
- the_mitsuhiko 4y agoIt supports 3.11 but not all syntax constructs of 3.11.
- dagurp 4y agoCan they claim to support it then?
- the_mitsuhiko 4y agoI don't know. But that's not unique to ruff. Plenty of Python linting tools had issues with new Python syntax in the past. Rust's rustfmt can still not format some of the most recent syntax additions and rust-analyzer has some limitations with new stuff as well.
- charliermarsh 4y agoThat's right -- we don't support match statements, and we don't support except* (which is part of 3.11 IIRC), but I _think_ we support everything else. And of course, I intend to support all of those language features. If interested: CPython moved to a new parser, a PEG parser, in Python 3.9, and part of the motivation was to support language features like pattern matching, which introduced ambiguities in the grammar that the existing parser couldn't handle. For the same reason, they've been non-trivial to implement in the RustPython parser -- they either require clever techniques, or the parser needs to be written as a PEG parser. I am hoping to do the former, but I need to find time to prioritize it.
- parlortricks 4y agoOh that explains why it is hung up on "match item['blah']:" then. I was scratching my head trying to work out what i had done wrong since the code worked fine. Love the tool