invalid-bytes-return-type (PLE0308)#
Derived from the Pylint linter.
This rule is unstable and in preview. The --preview
flag is required for use.
What it does#
Checks for __bytes__
implementations that return a type other than bytes
.
Why is this bad?#
The __bytes__
method should return a bytes
object. Returning a different
type may cause unexpected behavior.
Example#
Use instead: