Python Snippets

The Python snippet collection contains helper functions for Python 3.6. It includes utilities for most common data types, such as primitivies, lists, dictionaries and date objects.

  • unfold

    Python, Function

    Builds a list, using an iterator function and an initial seed value.

  • difference_by

    Python, List

    Returns the difference between two lists, after applying the provided function to each list element of both.

  • intersection_by

    Python, List

    Returns a list of elements that exist in both lists, after applying the provided function to each list element of both.

  • check_prop

    Python, Function

    Creates a function that will invoke a predicate function for the specified property on a given object.

  • compose

    Python, Function

    Performs right-to-left function composition.

  • compose_right

    Python, Function

    Performs left-to-right function composition.

  • curry

    Python, Function

    Curries a function.

  • when

    Python, Function

    Tests a value, x, against a testing function, conditionally applying a function.

  • delay

    Python, Function

    Invokes the provided function after ms milliseconds.