in multi-threaded environmentthe lbyl approach can risk introducing race condition between "the lookingand "the leapingfor examplethe codeif key in mappingreturn mapping[keycan fail if another thread removes key from mapping after the testbut before the lookup this issue can be solved with locks or by using the eafp approach list built-in python sequence despite its name it is more akin to an array in other languages than to linked list since access to elements is ( list comprehension compact way to process all or part of the elements in sequence and return list with the results result ['{:# }format(xfor in range( if = generates list of strings containing even hex numbers ( in the range from to the if clause is optional if omittedall elements in range( are processed loader an object that loads module it must define method named load_module( loader is typically returned by finder see pep for details and importlib abc loader for an abstract base class mapping container object that supports arbitrary key lookups and implements the methods specified in the mapping or mutablemapping abstract base classes examples include dictcollections defaultdictcollections ordereddict and collections counter meta path finder finder returned by search of sys meta_path meta path finders are related tobut different from path entry finders see importlib abc metapathfinder for the methods that meta path finders implement metaclass the class of class class definitions create class namea class dictionaryand list of base classes the metaclass is responsible for taking those three arguments and creating the class most object oriented programming languages provide default implementation what makes python special is that it is possible to create custom metaclasses most users never need this toolbut when the need arisesmetaclasses can provide powerfulelegant solutions they have been used for logging attribute accessadding thread-safetytracking object creationimplementing singletonsand many other tasks more information can be found in metaclasses method function which is defined inside class body if called as an attribute of an instance of that classthe method will get the instance object as its first argument (which is usually called selfsee function and nested scope method resolution order method resolution order is the order in which base classes are searched for member during lookup see the python method resolution order for details of the algorithm used by the python interpreter since the release module an object that serves as an organizational unit of python code modules have namespace containing arbitrary python objects modules are loaded into python by the process of importing see also package module spec namespace containing the import-related information used to load module an instance of importlib machinery modulespec mro see method resolution order mutable mutable objects can change their value but keep their id(see also immutable named tuple any tuple-like class whose indexable elements are also accessible using named attributes (for exampletime localtime(returns tuple-like object where the year is accessible either with an index such as [ or with named attribute like tm_yeara named tuple can be built-in type such as time struct_timeor it can be created with regular class definition full featured named tuple can also be created with the factory function collections namedtuple(the latter approach automatically provides extra features such as self-documenting representation like employee(name='jones'title='programmer' appendix glossary