What's wrong
WPS349 checking redundant components in a subscript’s slice
In case when array[0] and array[0:1] return same types the rule is working correct:
array = [1, 2, 3]
array[0] # <- no error, return int
array[0:1] # <- WPS349 violation, return int
But for bytes it broken because different types is returning:
array = b"123"
array[0] # <- no error, return int
array[0:1] # <- WPS349 violation, but return bytes
How it should be
I'm expected no violation error.
Flake8 version and plugins
{
"platform": {
"python_implementation": "CPython",
"python_version": "3.12.10",
"system": "Linux"
},
"plugins": [
{
"plugin": "mccabe",
"version": "0.7.0"
},
{
"plugin": "pycodestyle",
"version": "2.14.0"
},
{
"plugin": "pyflakes",
"version": "3.4.0"
},
{
"plugin": "wemake-python-styleguide",
"version": "1.6.1"
}
],
"version": "7.3.0"
}
pip information
Not sure if that's necessary in this case.
OS information
Not sure if that's necessary in this case.
What's wrong
WPS349 checking redundant components in a subscript’s slice
In case when
array[0]andarray[0:1]return same types the rule is working correct:But for
bytesit broken because different types is returning:How it should be
I'm expected no violation error.
Flake8 version and plugins
pip information
Not sure if that's necessary in this case.
OS information
Not sure if that's necessary in this case.