WPS345 and custom types
See original GitHub issueWhat’s wrong
WPS345 should not be raised when custom types are involved. Code such as
my_custom_obj * 0
cannot be replaced by 0, and the object may not allow assigning 0 to it directly.
How it should be
These checks should only work for builtin types, and maybe a user-defined list of custom types (e.g. Numpy arrays).
Flake8 version and plugins
Irrelevant.
pip information
Irrelevant.
OS information
All OS.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Custom Types - Eno
1. Parsing a document · 1.1. Providing the source · 1.2. Localized errors · 1.3. Error formats · 1.4. Cursor lookup ; 2....
Read more >WPS3xx Consistency - flake8 error codes
We like our code to be consistent. It is easier to bare with your code base if you follow these rules. So, we...
Read more >wemake-python-styleguide - Issuehunt
Forbid classes with too many public instance attributes ... False positive for `WPS345 Found meaningless number operation` ... WPS345 and custom types.
Read more >WDA : Hydraulic Wiper Seals Manufacturers ... - Max Spare
Part No. ID OD THK Material Mould No.
W130026201 2.00 9.00 4/5.2 FKM WPS‑4559
W13003L401 3.00 9.00 3/4 PU WPH‑2559
W130036601 3.00 9.00 4/5.50 FKM WPS‑2150...
Read more >Python Data Types - AskPython
There are many pre-defined Python data types. We can create our own classes to define custom data types in Python. Python data type...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, I guess that it is difficult to know the types in a flake8 plugin. I think that I can take a different approach, at least for my types, or simply ignore it with
noqa
as this pattern is not that common.Feel free to close this issue if you want.
Thanks a lot for the report! 👍