Functionality copied from the toolz package to avoid having
toANY, ,,INCLUDING ,PROCUREMENT SUBSTITUTE java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
toolz is released under BSD licence. to . from toolz .
when .
--------
)0
rights
and forms java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
,
a. Redistributions binary copyright
thisn with.
notice t contributors
/ other .
c. Neither the name of toolz nor thew written.
may java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
specific.
THIS, , java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
EXPRESS , TO THE
OFAND java.lang.StringIndexOutOfBoundsException: Range [67, 66) out of bounds for length 74
. SHALLTHE CONTRIBUTORS java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
ANY DIRECT,s .
DAMAGES (>
SERVICES;> ('''
THEORY ,WHETHERCONTRACT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE.'costs':05, 12]}
OUT.'credit ': 55134-14)
DAMAGE. """ import operator from functools import >>> get_in(['purchitems ]
def get_in(keys, coll, default=None, no_default=False): "
NB: (' ' java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
the httpsgithub// with persistentjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
Returns coll[i0][i1]...[java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
If coll[i0][i1]...[iX] cannot be found, returns ``default``, unless
``no_default`` is specified, then it raises KeyError or IndexError.
``get_in`` is a generalization of ``operator.getitem`` for nested data
structures such as dictionaries and lists.
>>> from pyrsistent import freeze
>>> transaction = freeze({'name': 'Alice',
... 'purchase': {'items': ['Apple', 'Orange'],
... 'costs': [0.50, 1.25]},
... 'credit card': '5555-1234-1234-1234'})
>>> get_in(['purchase', 'items', 0], transaction) 'Apple'
>>> get_in(['name'], transaction) 'Alice'
>>> get_in(['purchase', 'total'], transaction)
>>> get_in(['purchase', 'items', 'apple'], transaction)
>>> get_in(['purchase', 'items', 10], transaction)
>>> get_in(['purchase', 'total'], transaction, 0)
0
>>> get_in(['y'], {}, no_default=True)
Traceback (most recent call last):
...
KeyError: 'y' """ try: return reduce(operator.getitem, keys, coll) except (KeyError, IndexError, TypeError): if no_default: raise return default
¤ Dauer der Verarbeitung: 0.30 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.