Skip to content

bytes() in python 2 #340

Description

@relikd

Not sure if this is a bug or intended behavior, but

bytes([1, 2])

does not raise any warnings. In Python 2, bytes is treated as str. On one hand, it makes sense that no warning is issued as str([1, 2]) is still valid code and will compile. But from a logical perspective, the code is inherently different. Python 3 will return b"\x01\x02" whereas Python 2 produces "[1, 2]".

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