Skip to content

Commit

Permalink
Added note about not memoizing __iter__.
Browse files Browse the repository at this point in the history
  • Loading branch information
pdonis committed Dec 15, 2011
1 parent fb4961e commit f5c3f1f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions powerseries.py
Expand Up @@ -187,6 +187,11 @@ def __iter__(self):
This makes a ``PowerSeries`` an iterable, which combined with the
properties below makes the notation simple.
Note that we do *not* memoize this method directly; we factor out
the memoized generator and just realize it here. This is because
``__iter__`` is a special method that is handled differently by
Python, so decorators don't work properly with it.
"""
return self._gen()

Expand Down

0 comments on commit f5c3f1f

Please sign in to comment.