Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
Thank you! I have found that pattern matching has made this project a whole lot easier.
One of the other cool features about this project is how the check() functions are loaded based off the type of the node argument:
https://github.com/dosisod/refurb/blob/master/refurb/loader....
This also supports type unions, so you can register your check for binary and unary expressions by typing node as `BinaryExpr | UnaryExpr`.
The reason I didn't just create a pylint/flake8/mypy plugin is because they all use a very specific methodology, whereas I wanted the freedom to architect it the way I wanted. Also, I really needed good type information, which is why I used mypy[0] as the AST parser/type checker.
[0]: https://github.com/python/mypy