KEMBAR78
fix DictReader definition by graingert · Pull Request #1475 · python/typeshed · GitHub
Skip to content

Conversation

graingert
Copy link
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
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
if sys.version_info >= (3,):
def __next__(self) -> OrderedDict[Any, str]: ...
else:
def next(self) -> OrderedDict[Any, str]: ...
Copy link
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
Copy link
Member

gvanrossum commented Jul 11, 2017 via email

@JelleZijlstra
Copy link
Member

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

@gvanrossum
Copy link
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