Skip to content

error: Argument 1 to "find" of "bytearray" has incompatible type "int"; expected "bytes" #2831

Closed
@5j9

Description

@5j9

Source code:

ba = bytearray('012}'.encode())
print(ba.find(125))

mypy error:

$ python -m mypy _test.py
_test.py:2: error: Argument 1 to "find" of "bytearray" has incompatible type "int"; expected "bytes"

Am I doing something wrong or is this some mypy (or maybe python) issue?

Thanks!

mypy 0.470
python 3.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions