shutil.register_archive_format()

shutil.register_archive_format(name, function[, extra_args[, description]]) Register an archiver for the format name. function is the callable that will be used to unpack archives. The callable will receive the base_name of the file to create, followed by the base_dir (which defaults to os.curdir) to start archiving from. Further arguments are passed as keyword arguments: owner, group, dry_run and logger (as passed in make_archive()). If given, extra_args is a sequence of (name, value) pairs

code.InteractiveConsole.resetbuffer()

InteractiveConsole.resetbuffer() Remove any unhandled source text from the input buffer.

email.generator.BytesGenerator.clone()

clone(fp) Return an independent clone of this BytesGenerator instance with the exact same options.

aifc.aifc.setframerate()

aifc.setframerate(rate) Specify the sampling frequency in frames per second.

code.compile_command()

code.compile_command(source, filename="", symbol="single") This function is useful for programs that want to emulate Python’s interpreter main loop (a.k.a. the read-eval-print loop). The tricky part is to determine when the user has entered an incomplete command that can be completed by entering more text (as opposed to a complete command or a syntax error). This function almost always makes the same decision as the real interpreter main loop. source is the source string; filename is the opt

code.InteractiveConsole.push()

InteractiveConsole.push(line) Push a line of source text to the interpreter. The line should not have a trailing newline; it may have internal newlines. The line is appended to a buffer and the interpreter’s runsource() method is called with the concatenated contents of the buffer as source. If this indicates that the command was executed or invalid, the buffer is reset; otherwise, the command is incomplete, and the buffer is left as it was after the line was appended. The return value is Tr

contextlib.ExitStack

class contextlib.ExitStack A context manager that is designed to make it easy to programmatically combine other context managers and cleanup functions, especially those that are optional or otherwise driven by input data. For example, a set of files may easily be handled in a single with statement as follows: with ExitStack() as stack: files = [stack.enter_context(open(fname)) for fname in filenames] # All opened files will automatically be closed at the end of # the with stateme

class.__mro__

class.__mro__ This attribute is a tuple of classes that are considered when looking for base classes during method resolution.

operator.neg()

operator.neg(obj) operator.__neg__(obj) Return obj negated (-obj).

getattr()

getattr(object, name[, default]) Return the value of the named attribute of object. name must be a string. If the string is the name of one of the object’s attributes, the result is the value of that attribute. For example, getattr(x, 'foobar') is equivalent to x.foobar. If the named attribute does not exist, default is returned if provided, otherwise AttributeError is raised.