Skip to content

bytes formatting incorrect in python 3 #2070

Closed
@euresti

Description

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

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions