From 94a7e2659e3e8b6a9183b59aed06223cc1706c87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Barrois?= Date: Sun, 3 Mar 2013 21:00:11 +0100 Subject: Update ChangeLog for 1.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Raphaƫl Barrois --- docs/reference.rst | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'docs/reference.rst') diff --git a/docs/reference.rst b/docs/reference.rst index edbd527..efb70e8 100644 --- a/docs/reference.rst +++ b/docs/reference.rst @@ -720,15 +720,24 @@ Iterator .. class:: Iterator(iterable, cycle=True, getter=None) -The :class:`Iterator` declaration takes succesive values from the given -iterable. When it is exhausted, it starts again from zero (unless ``cycle=False``). + The :class:`Iterator` declaration takes succesive values from the given + iterable. When it is exhausted, it starts again from zero (unless ``cycle=False``). -The ``cycle`` argument is only useful for advanced cases, where the provided -iterable has no end (as wishing to cycle it means storing values in memory...). + .. attribute:: cycle -.. versionadded:: 1.3.0 - The ``cycle`` argument is available as of v1.3.0; previous versions - had a behaviour equivalent to ``cycle=False``. + The ``cycle`` argument is only useful for advanced cases, where the provided + iterable has no end (as wishing to cycle it means storing values in memory...). + + .. versionadded:: 1.3.0 + The ``cycle`` argument is available as of v1.3.0; previous versions + had a behaviour equivalent to ``cycle=False``. + + .. attribute:: getter + + A custom function called on each value returned by the iterable. + See the :ref:`iterator-getter` section for details. + + .. versionadded:: 1.3.0 Each call to the factory will receive the next value from the iterable: @@ -756,6 +765,8 @@ When a value is passed in for the argument, the iterator will *not* be advanced: >>> UserFactory().lang 'fr' +.. _iterator-getter: + Getter ~~~~~~ @@ -764,8 +775,6 @@ This is handled by the :attr:`~Iterator.getter` attribute: this is a function that accepts as sole parameter a value from the iterable, and returns an adequate value. -.. versionadded:: 1.3.0 - .. code-block:: python class UserFactory(factory.Factory): -- cgit v1.2.3