Skip to content

add IncrementalNewlineDecoder constructor#3311

Merged
srittau merged 3 commits intopython:masterfrom
rmorshea:patch-1
Oct 6, 2019
Merged

add IncrementalNewlineDecoder constructor#3311
srittau merged 3 commits intopython:masterfrom
rmorshea:patch-1

Conversation

@rmorshea
Copy link
Contributor

@rmorshea rmorshea commented Oct 6, 2019

IncrementalNewlineDecoder defined a new constructor because it wraps other decoders.

See: https://github.com/python/cpython/blob/65dcc8a8dc41d3453fd6b987073a5f1b30c5c0fd/Lib/_pyio.py#L1886

Copy link
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, one comment below. I don't know why pytype fails, but let's see what happens if this problem gets solved.

stdlib/3/io.pyi Outdated

class IncrementalNewlineDecoder(codecs.IncrementalDecoder):
def __init__(self, decoder: Optional[codecs.IncrementalDecoder],
translate: bool, errors: str = 'strict') -> None: ...
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default values must be .... This is also why flake8 fails.

@rmorshea rmorshea requested a review from srittau October 6, 2019 10:50
@srittau srittau merged commit b9342ec into python:master Oct 6, 2019
@rmorshea rmorshea deleted the patch-1 branch October 6, 2019 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants