python runtime services his describes modules that are related to the python interpreter runtime topics include garbage collectionbasic management of objects (copyingmarshallingand so on)weak referencesand interpreter environment atexit the atexit module is used to register functions to execute when the python interpreter exits single function is providedregister(func [,args [,kwargs]]adds function func to list of functions that will execute when the interpreter exits args is tuple of arguments to pass to the function kwargs is dictionary of keyword arguments the function is invoked as func(*args,**kwargsupon exitfunctions are invoked in reverse order of registration (the most recently added exit function is invoked firstif an error occursan exception message will be printed to standard error but will otherwise be ignored copy the copy module provides functions for making shallow and deep copies of compound objectsincluding liststuplesdictionariesand instances of user-defined objects copy(xmakes shallow copy of by creating new compound object and duplicating the members of by reference for built-in typesit is somewhat uncommon to use this function insteadyou use calls such as list( )dict( )set( )and so forth to create shallow copy of (it should be noted that using the type name directly like this is also significantly faster than using copy()deepcopy( [visit]makes deep copy of by creating new compound object and recursively duplicating all the members of visit is an optional dictionary that' used to keep track of visited objects in order to detect and avoid cycles in recursively defined data structures this argument is typically only supplied if deepcopy(is being called recursively as described later in this lib fl ff