6try:
7 from functools import cache
8except ImportError: # Python 3.8
9 cache = lambda f: f 10from hashlib import md5
11from os import getenv, getpid, makedirs, mkdir, rmdir
12from os.path import basename, dirname, exists, isfile, join, normpath
39 negate = lambda b: not b
40 selector = selector[1:]
41 else:
42 negate = lambda b: b 43 try:
44 selector_type, selector_name = selector.split(":", 1)
45 except ValueError:
36 all items matching that selector from the given list of items.
37 """
38 if selector.startswith("!"):
39 negate = lambda b: not b 40 selector = selector[1:]
41 else:
42 negate = lambda b: b
110 elif self.attributes['manifest_processor'] == 'mako':
111 content_processor = content_processor_mako
112 else:
113 content_processor = lambda item: item._template_content.encode('utf-8')114
115 if self.attributes['manifest'] is not None or self.attributes['manifest_file'] is None:
116 user_manifest = self.attributes['manifest'] or {}
Lambdas should not be assigned to a variable. Instead, they should be defined as functions. The primary reason for this is debugging. Lambdas show as <lambda>
in tracebacks, where functions will display the function’s name.