Skip to content

bytes() and bytearray() should have the default values for errors for string sources #137100

@hyperkai

Description

@hyperkai

bytes() and bytearray() don't show the default values for source, encoding and errors as shown below:

class bytearray(source=b'')
class bytearray(source, encoding)
class bytearray(source, encoding, errors)

class bytes(source=b'')
class bytes(source, encoding)
class bytes(source, encoding, errors)

So, they should have the default values as shown below:

class bytearray(source=b'')
class bytearray(source, encoding='utf-8')
class bytearray(source, encoding='utf-8', errors='strict')

class bytes(source=b'')
class bytes(source, encoding='utf-8')
class bytes(source, encoding='utf-8', errors='strict')

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions