flake8-bugbear B903 suggestion : Do not raise error if keyword argument is present and target-python version is less or equals than 3.9 #15548
Labels
rule
Implementing or modifying a lint rule
Hello,
I have this piece of code in one of my repo
When I did this, I started by using dataclass, although I wanted the 3 arguments of the
__init__
function to be keywords only. As dataclass does not supportkw_only
before python 3.10 (reference https://docs.python.org/3/library/dataclasses.html#module-contents), I ended up writing the__init__
function myself.With the current implementation of B903, this will raise an error. My suggestion would be not to raise error if an keyword only argument and target-version<=3.9.
I'm currently raising a pull request, if you think my suggestion is ok, I'll let you review.
The text was updated successfully, but these errors were encountered: