Get iterable content using __iter__() and __next__().
ClosedPublic

Authored by flherne on Nov 29 2016, 8:20 PM.

Details

Summary

BUG: 369363
Supports unpacking and iterating over custom sequence types.
See tests for examples (some by Nicolás Alvarez).

Returning iter(builtin_container) isn't handled usefully because they use docstring cheats with no real return values.

Test Plan

Added tests for new functionality.
No regressions in existing tests.

Processed some small projects and quite a bit of CPython without crashing.

Diff Detail

Repository
R53 KDevelop: Python Support
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
flherne updated this revision to Diff 8611.Nov 29 2016, 8:20 PM
flherne retitled this revision from to Get iterable content using __iter__() and __next__()..
flherne updated this object.
flherne edited the test plan for this revision. (Show Details)
flherne added a reviewer: brauch.
flherne set the repository for this revision to R53 KDevelop: Python Support.
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptNov 29 2016, 8:20 PM
brauch accepted this revision.Nov 29 2016, 9:37 PM
brauch edited edge metadata.

Looks sensible for me and the test are nice. Eventually we should port some things from builtindocumentation.py to this? (e.g. range())

This revision is now accepted and ready to land.Nov 29 2016, 9:37 PM
This revision was automatically updated to reflect the committed changes.