Skip to content

bytes formatting incorrect in python 3 #2070

Closed
@euresti

Description

@euresti

The following runs properly:

def foo(a: bytes, b:bytes) -> bytes:
    return b'%s:%s' % (a, b)
assert foo(b'a', b'b') == b'a:b'

However mypy complains:

example.py: note: In function "foo":
example.py:2: error: Incompatible return value type (got "str", expected "bytes")

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions