concurrent.futures.ProcessPoolExecutor

class concurrent.futures.ProcessPoolExecutor(max_workers=None) An Executor subclass that executes calls asynchronously using a pool of at most max_workers processes. If max_workers is None or not given, it will default to the number of processors on the machine. If max_workers is lower or equal to 0, then a ValueError will be raised. Changed in version 3.3: When one of the worker processes terminates abruptly, a BrokenProcessPool error is now raised. Previously, behaviour was undefined but

threading.Event.wait()

wait(timeout=None) Block until the internal flag is true. If the internal flag is true on entry, return immediately. Otherwise, block until another thread calls set() to set the flag to true, or until the optional timeout occurs. When the timeout argument is present and not None, it should be a floating point number specifying a timeout for the operation in seconds (or fractions thereof). This method returns true if and only if the internal flag has been set to true, either before the wait c

inspect.iscode()

inspect.iscode(object) Return true if the object is a code.

types.DynamicClassAttribute()

types.DynamicClassAttribute(fget=None, fset=None, fdel=None, doc=None) Route attribute access on a class to __getattr__. This is a descriptor, used to define attributes that act differently when accessed through an instance and through a class. Instance access remains normal, but access to an attribute through a class will be routed to the class’s __getattr__ method; this is done by raising AttributeError. This allows one to have properties active on an instance, and have virtual attributes

winreg.LoadKey()

winreg.LoadKey(key, sub_key, file_name) Creates a subkey under the specified key and stores registration information from a specified file into that subkey. key is a handle returned by ConnectRegistry() or one of the constants HKEY_USERS or HKEY_LOCAL_MACHINE. sub_key is a string that identifies the subkey to load. file_name is the name of the file to load registry data from. This file must have been created with the SaveKey() function. Under the file allocation table (FAT) file system, the

ctypes._FuncPtr.restype

restype Assign a ctypes type to specify the result type of the foreign function. Use None for void, a function not returning anything. It is possible to assign a callable Python object that is not a ctypes type, in this case the function is assumed to return a C int, and the callable will be called with this integer, allowing further processing or error checking. Using this is deprecated, for more flexible post processing or error checking use a ctypes data type as restype and assign a calla

sys.getsizeof()

sys.getsizeof(object[, default]) Return the size of an object in bytes. The object can be any type of object. All built-in objects will return correct results, but this does not have to hold true for third-party extensions as it is implementation specific. Only the memory consumption directly attributed to the object is accounted for, not the memory consumption of objects it refers to. If given, default will be returned if the object does not provide means to retrieve the size. Otherwise a T

pathlib.Path.rglob()

Path.rglob(pattern) This is like calling glob() with “**” added in front of the given pattern: >>> sorted(Path().rglob("*.py")) [PosixPath('build/lib/pathlib.py'), PosixPath('docs/conf.py'), PosixPath('pathlib.py'), PosixPath('setup.py'), PosixPath('test_pathlib.py')]

gc.callbacks

gc.callbacks A list of callbacks that will be invoked by the garbage collector before and after collection. The callbacks will be called with two arguments, phase and info. phase can be one of two values: “start”: The garbage collection is about to start. “stop”: The garbage collection has finished. info is a dict providing more information for the callback. The following keys are currently defined: “generation”: The oldest generation being collected. “collected”: When phase is “stop”, the n

curses.def_prog_mode()

curses.def_prog_mode() Save the current terminal mode as the “program” mode, the mode when the running program is using curses. (Its counterpart is the “shell” mode, for when the program is not in curses.) Subsequent calls to reset_prog_mode() will restore this mode.