How to use the funcy.compat.map function in funcy

To help you get started, we’ve selected a few funcy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Suor / funcy / funcy / colls.py View on Github external
def pluck(key, mappings):
    """Iterates over values for key in mappings."""
    return map(itemgetter(key), mappings)
github Suor / funcy / funcy / strings.py View on Github external
def str_join(sep, seq=EMPTY):
    """Joins the given sequence with sep.
       Forces stringification of seq items."""
    if seq is EMPTY:
        return str_join('', sep)
    else:
        return sep.join(map(sep.__class__, seq))
github Suor / funcy / funcy / colls.py View on Github external
def invoke(objects, name, *args, **kwargs):
    """Yields results of the obj.name(*args, **kwargs)
       for each object in objects."""
    return map(methodcaller(name, *args, **kwargs), objects)
github Suor / funcy / funcy / colls.py View on Github external
def pluck_attr(attr, objects):
    """Iterates over values of given attribute of given objects."""
    return map(attrgetter(attr), objects)