faif / python-patterns

A collection of design patterns/idioms in Python
40.46k stars 6.94k forks source link

Added alternative implementation for Iterator pattern using the Iterator protocol #320

Closed sevetseh28 closed 4 years ago

sevetseh28 commented 4 years ago

In this PR I add the alternative version on how to implement the Iterator pattern using the Iterator protocol from Python. I followed the same example in the original version so that they can be easily compared.

codecov-io commented 4 years ago

Codecov Report

Merging #320 into master will decrease coverage by 0.41%. The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #320      +/-   ##
==========================================
- Coverage   30.57%   30.15%   -0.42%     
==========================================
  Files          38       39       +1     
  Lines        1243     1260      +17     
==========================================
  Hits          380      380              
- Misses        863      880      +17
Impacted Files Coverage Δ
patterns/behavioral/iterator_alt.py 0% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 937a4ed...2fdbac5. Read the comment docs.