fnmatch.fnmatch()

fnmatch.fnmatch(filename, pattern) Test whether the filename string matches the pattern string, returning True or False. If the operating system is case-insensitive, then both parameters will be normalized to all lower- or upper-case before the comparison is performed. fnmatchcase() can be used to perform a case-sensitive comparison, regardless of whether that’s standard for the operating system. This example will print all file names in the current directory with the extension .txt: import

SystemExit.code

code The exit status or error message that is passed to the constructor. (Defaults to None.)

urllib.request.HTTPRedirectHandler.http_error_302()

HTTPRedirectHandler.http_error_302(req, fp, code, msg, hdrs) The same as http_error_301(), but called for the ‘found’ response.

inspect.BoundArguments.apply_defaults()

apply_defaults() Set default values for missing arguments. For variable-positional arguments (*args) the default is an empty tuple. For variable-keyword arguments (**kwargs) the default is an empty dict. >>> def foo(a, b='ham', *args): pass >>> ba = inspect.signature(foo).bind('spam') >>> ba.apply_defaults() >>> ba.arguments OrderedDict([('a', 'spam'), ('b', 'ham'), ('args', ())]) New in version 3.5.

dir()

dir([object]) Without arguments, return the list of names in the current local scope. With an argument, attempt to return a list of valid attributes for that object. If the object has a method named __dir__(), this method will be called and must return the list of attributes. This allows objects that implement a custom __getattr__() or __getattribute__() function to customize the way dir() reports their attributes. If the object does not provide __dir__(), the function tries its best to gath

pkgutil.iter_modules()

pkgutil.iter_modules(path=None, prefix='') Yields (module_finder, name, ispkg) for all submodules on path, or, if path is None, all top-level modules on sys.path. path should be either None or a list of paths to look for modules in. prefix is a string to output on the front of every module name on output. Note Only works for a finder which defines an iter_modules() method. This interface is non-standard, so the module also provides implementations for importlib.machinery.FileFinder and zipi

itertools.takewhile()

itertools.takewhile(predicate, iterable) Make an iterator that returns elements from the iterable as long as the predicate is true. Roughly equivalent to: def takewhile(predicate, iterable): # takewhile(lambda x: x<5, [1,4,6,4,1]) --> 1 4 for x in iterable: if predicate(x): yield x else: break

winreg.EnumValue()

winreg.EnumValue(key, index) Enumerates values of an open registry key, returning a tuple. key is an already open key, or one of the predefined HKEY_* constants. index is an integer that identifies the index of the value to retrieve. The function retrieves the name of one subkey each time it is called. It is typically called repeatedly, until an OSError exception is raised, indicating no more values. The result is a tuple of 3 items: Index Meaning 0 A string that identifies the value name 1

asyncio.WriteTransport

class asyncio.WriteTransport Interface for write-only transports. abort() Close the transport immediately, without waiting for pending operations to complete. Buffered data will be lost. No more data will be received. The protocol’s connection_lost() method will eventually be called with None as its argument. can_write_eof() Return True if the transport supports write_eof(), False if not. get_write_buffer_size() Return the current size of the output buffer used by the transpor

difflib.SequenceMatcher.set_seqs()

set_seqs(a, b) Set the two sequences to be compared.