There is usually no problem with creating local functions - or using lambdas - and I usually do when they make the intent that much more clear.
However, making this class of specialized functions part of the core language is generally unnecessary, and to add such as global/built-in function (or even as methods on the particular type) tends to head down the path of a bloated core: e.g. why not also is_prime
or is_natural
?
def do_my_stuff(numbers):
def is_even(i):
return i % 2 == 0
# use is_even, where it can be trivially referenced above
return map(is_even, numbers)