Bug Report
On Python 3 formatting "b'abc'" with "{}" produces "b'abc'", not "abc" gets produced during bidirectional inference in a failed overload match.
To Reproduce
fromtypingimportoverload, Callable@overloaddefsub(pattern: str, repl: Callable[[str], str]) ->str: ...
@overloaddefsub(pattern: bytes, repl: Callable[[bytes], bytes]) ->bytes: ...
defsub(pattern: object, repl: object) ->object:
raiseNotImplementedErrordefbetter_snakecase(text: str) ->str:
text=sub(r"([A-Z])([A-Z]+)([A-Z](?:[^A-Z]|$))", lambdamatch: f"{match}")
returntextExpected Behavior
No errors
Actual Behavior
test_cases/stdlib/typing/pattern.py:11: error: On Python 3 formatting "b'abc'" with "{}" produces "b'abc'", not "abc"; use "{!r}" if this is desired behavior
Your Environment
- Mypy version used: master, 0.942
- Mypy command-line flags: none
Found in python/typeshed#7679, the repro case minified from some code in homeassistant.
Bug Report
On Python 3 formatting "b'abc'" with "{}" produces "b'abc'", not "abc"gets produced during bidirectional inference in a failed overload match.To Reproduce
Expected Behavior
No errors
Actual Behavior
Your Environment
Found in python/typeshed#7679, the repro case minified from some code in homeassistant.