From: Jason Kirtland Date: Tue, 1 Apr 2008 16:49:55 +0000 (+0000) Subject: - Tighten up r4399 _set_iterable docs X-Git-Tag: rel_0_4_5~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e0a91fe81cd8cf38603c7147ebf2e79301be6f5;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - Tighten up r4399 _set_iterable docs --- diff --git a/lib/sqlalchemy/orm/attributes.py b/lib/sqlalchemy/orm/attributes.py index f0b1510f97..a511c9bbb6 100644 --- a/lib/sqlalchemy/orm/attributes.py +++ b/lib/sqlalchemy/orm/attributes.py @@ -586,18 +586,17 @@ class CollectionAttributeImpl(AttributeImpl): lambda adapter, i: adapter.adapt_like_to_iterable(i)) def _set_iterable(self, state, iterable, adapter=None): - """Set a collection value from an interable. + """Set a collection value from an iterable of state-bearers. ``adapter`` is an optional callable invoked with a CollectionAdapter - and the iterable. Should return an iterable of instances suitable for - appending via a CollectionAdapter. Can be used for, e.g., adapting an - incoming dictionary iterable to a list. + and the iterable. Should return an iterable of state-bearing + instances suitable for appending via a CollectionAdapter. Can be used + for, e.g., adapting an incoming dictionary into an iterator of values + rather than keys. """ - # we need a CollectionAdapter to adapt the incoming value to an - # assignable iterable. pulling a new collection first so that - # an adaptation exception does not trigger a lazy load of the - # old collection. + # pulling a new collection first so that an adaptation exception does + # not trigger a lazy load of the old collection. new_collection, user_data = self._build_collection(state) if adapter: new_values = list(adapter(new_collection, iterable))