WPS432 should preserve the literal representation
See original GitHub issueBug report
This code
import pathlib
path = pathlib.Path('.')
path.chmod(0o700)
causes
WPS432: Found magic number: 448
It’s unobvious that it’s the same number and it’s impossible to use 448
in grep because it won’t find anything.
What’s wrong
Non-decimal numbers are reported as decimal. Also, maybe for things like chmod()
it’s okay to allow such “magic numbers” because this form directly relates to a normal syscall or a CLI command one would make.
How is that should be
The formatting should be preserved. The error should’ve been WPS432: Found magic number: 0o700
instead.
System information
N/A
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Source code for skfda.datasets._real_datasets - Read the Docs
Each speech frame is represented by 512 samples at a 16kHz sampling rate, ... Bunch: pass @overload def fetch_phoneme( *, return_X_y: Literal[True], ...
Read more >PCEP:M2 - Literals Flashcards - Quizlet
Study with Quizlet and memorize flashcards containing terms like literal encode, binary numbers integers fractional floating fractional, type literal memory ...
Read more >wemake-python-styleguide - Issuehunt
WPS432 should preserve the literal representation. Unfunded#1402created bywebknjaz. $0.00. WPS440 is wrong in compat shim modules.
Read more >Python Data Types & Literals - Tools QA
Python Literal - Character, String and Boolean ... But in the hexadecimal number system, we have to represent the number from 10 -...
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
Nice! Will wait for the PR.
Then you should probably use
libcst
, see #1068 I am going to merge this PR soon.