Skip to content

fix DictReader definition#1475

Merged
JelleZijlstra merged 1 commit into
python:masterfrom
graingert:patch-2
Jul 11, 2017
Merged

fix DictReader definition#1475
JelleZijlstra merged 1 commit into
python:masterfrom
graingert:patch-2

Conversation

@graingert

Copy link
Copy Markdown
Contributor
  • constructable with Iterable
  • supports __next__ on python 3
  • supports next on python 2

* constructable with Iterable
* __iter__ returns another DictReader
* supports `__next__` on python 3
* supports `next` on python 2
@graingert

Copy link
Copy Markdown
Contributor Author

and I've updated the documentation on cpython accordingly: python/cpython#2653

@JelleZijlstra JelleZijlstra merged commit 7637549 into python:master Jul 11, 2017
Comment thread stdlib/2and3/csv.pyi
if sys.version_info >= (3,):
def __next__(self) -> OrderedDict[Any, str]: ...
else:
def next(self) -> OrderedDict[Any, str]: ...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Wondering if these should be regular dicts on python < 3.6

@gvanrossum

gvanrossum commented Jul 11, 2017 via email

Copy link
Copy Markdown
Member

@JelleZijlstra

Copy link
Copy Markdown
Member

I think so, there was a regression since 0.511 (DictReader could not be instantiated).

@gvanrossum

Copy link
Copy Markdown
Member

Oh, that's serious indeed. IIRC I ran into that too and tried to fix it (8607064) but didn't test it for Python 3. :-( I guess the commit that caused all this (1c84982) was a bit careless about it.

@JelleZijlstra JelleZijlstra mentioned this pull request Jul 11, 2017
25 tasks
@graingert graingert deleted the patch-2 branch July 12, 2017 15:10
gvanrossum pushed a commit that referenced this pull request Jul 18, 2017
* constructable with Iterable
* __iter__ returns another DictReader
* supports `__next__` on python 3
* supports `next` on python 2
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.

3 participants