[New Concept Docs]: `iterators`
This issue describes how to implement the iterators concept docs.
You can find the related concept exercise issue here
If you have not yet contributed to concept documents, this issue will require some upfront reading to give you the needed background knowledge.
â Getting started
Please please read the docs before starting. Posting PRs without reading these docs will be a lot more frustrating for you during the review cycle, and exhaust Exercism's maintainers' time.
General Contributing Docs:
- Contributing to Exercism | Exercism and GitHub | - Contributor Pull Request Guide
- What are those Weird Task Tags about?
- Exercism Formatting and Style Guide
- Exercism Markdown Specification
- Reputation
Documents on Language Tracks and Concepts:
đ¯ Goal
These concept docs are meant to teach an understanding, creation, and use of itertators in Python.
đĄ Learning objectives
Learn more about how looping / iteration and the iterator protocol work in Python, and the options available for creating & customizing iterators.
- How
loopsin Python implement theiterator protocol -
iteration"under the covers" - How
iterablesare defined - Understand and use the built-in
iter()to return aniterator - Create/use one or more custom
iteratorsvia defining aclass - Understand how
class-created iterators relate togenerators, and the pros and cons of each approach
đĢ Out of scope
Concepts and Subjects that are Out of Scope
-
classes&class customizationbeyond the use of theiteratordunder methods anditerator protocol -
class-inheritancebeyond what is needed to customizeiterationfor acontainer typeor otherclass -
comprehensions -
comprehensionsinlambdas -
coroutines -
decorators -
functoolsand relatedmap(),filter()andfunctools.reduce() -
generatorsin-depth as a specific form of iterators (these have their own exercise) -
higher-order functions -
lambdas - using an
assignment expressionor "walrus" operator (:=) - class decorators
-
enums
đ¤ Concepts
Concepts and Related Concepts this Concept Covers
-
loopsin Python -
iterationin Python -
iterators&iterator types - The
iterator protocol -
iterables&enumeration
âŠī¸ Prerequisites
These are the concepts/concept exercises the student should be familiar with before taking on/learning this concept.
Prereqs
-
basics -
booleans -
classes -
comparisons -
rich-comparisons -
decorators -
descriptors -
dicts -
dict-methods -
functions -
higher-order-functions -
lists -
list-methods -
numbers -
sequences -
sets -
strings -
string-methods -
tuples
đ Resources to refer to
Resources
đ Files to Be Created
File Detail for this Concept
|
Please see the following for more details on these files: concepts
|
đļ Implementation Notes
- Example code should only use syntax & concepts introduced within these docs or one of the prerequisite concept exercises or documents. Where possible, please use REPL formatting, unless you are demonstrating pseudo code or a long code block. Please do not use syntax not previously covered in prerequisite topics or exercises. Please also follow PEP8 guidelines.
- Our markdown and JSON files are checked against prettier . We recommend setting prettier up locally and running it prior to submitting your PR to avoid any CI errors.
đ Next Steps & Getting Help
-
If you'd like to work on this issue, comment saying "I'd like to work on this"(there is no real need to wait for a response, just go ahead, we'll assign you and put a[claimed]label on the issue). - If you have any questions while implementing, please post the questions as comments in here, or contact one of the maintainers on our Slack channel.