In the experiment below, we compare the computational efficiency of list comprehensions versus for looping. It is a very simple, illustrative setup not meant to lead to general conclusions.
# non-local transform
def transform(value):
return value
# comprehension-based list generation
def comprehension(ns):