Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)
Return a consistent (key, value) iterable on dict-like objects,
including lists of tuple pairs.

Example:

    >>> list(iterate_items({'a': 1}))
    [('a', 1)]
    >>> list(iterate_items([('a', 1), ('b', 2)]))
    [('a', 1), ('b', 2)]

        def iterate_items(dictish):
    """ Return a consistent (key, value) iterable on dict-like objects,
    including lists of tuple pairs.

    Example:

        >>> list(iterate_items({'a': 1}))
        [('a', 1)]
        >>> list(iterate_items([('a', 1), ('b', 2)]))
        [('a', 1), ('b', 2)]
    """
    if hasattr(dictish, 'iteritems'):
        return dictish.iteritems()
    if hasattr(dictish, 'items'):
        return dictish.items()
    return dictish
        


src/u/n/unstdlib-1.6.1/unstdlib/standard/functools_.py   unstdlib(Download)
from functools import wraps
import warnings
 
from .list_ import iterate_items
 
        raise TypeError('Argument in position %d is not hashable: %r' % (i, arg))
    try:
        for key, val in iterate_items(kw):
            hash(val)
    except TypeError:

src/u/n/unstdlib.py-HEAD/unstdlib/standard/functools_.py   unstdlib.py(Download)
from functools import wraps, partial
import warnings
 
from .list_ import iterate_items
 
        raise TypeError('Argument in position %d is not hashable: %r' % (i, arg))
    try:
        for key, val in iterate_items(kw):
            hash(val)
    except TypeError: