KEMBAR78
Incorrect join of str and subclass of unicode · Issue #8394 · python/mypy · GitHub
Skip to content

Incorrect join of str and subclass of unicode #8394

@JukkaL

Description

@JukkaL

Joins of str and a subclass of unicode (in Python 2) are calculated inconsistently:

class S(unicode): pass

reveal_type('' if bool() else S())  # Sequence[unicode]
reveal_type(S() if bool() else '')  # unicode

This is probably caused by the promotion from str to unicode being handled differently depending on the order of the join operands.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions