multiprocessing.Lock

class multiprocessing.Lock A non-recursive lock object: a close analog of threading.Lock. Once a process or thread has acquired a lock, subsequent attempts to acquire it from any process or thread will block until it is released; any process or thread may release it. The concepts and behaviors of threading.Lock as it applies to threads are replicated here in multiprocessing.Lock as it applies to either processes or threads, except as noted. Note that Lock is actually a factory function which

str

class str(object='') class str(object=b'', encoding='utf-8', errors='strict') Return a str version of object. See str() for details. str is the built-in string class. For general information about strings, see Text Sequence Type — str.

fractions.Fraction.__floor__()

__floor__() Returns the greatest int <= self. This method can also be accessed through the math.floor() function: >>> from math import floor >>> floor(Fraction(355, 113)) 3

os.set_handle_inheritable()

os.set_handle_inheritable(handle, inheritable) Set the “inheritable” flag of the specified handle. Availability: Windows.

filecmp.cmp()

filecmp.cmp(f1, f2, shallow=True) Compare the files named f1 and f2, returning True if they seem equal, False otherwise. If shallow is true, files with identical os.stat() signatures are taken to be equal. Otherwise, the contents of the files are compared. Note that no external programs are called from this function, giving it portability and efficiency. This function uses a cache for past comparisons and the results, with cache entries invalidated if the os.stat() information for the file c

datetime.tzinfo.dst()

tzinfo.dst(dt) Return the daylight saving time (DST) adjustment, in minutes east of UTC, or None if DST information isn’t known. Return timedelta(0) if DST is not in effect. If DST is in effect, return the offset as a timedelta object (see utcoffset() for details). Note that DST offset, if applicable, has already been added to the UTC offset returned by utcoffset(), so there’s no need to consult dst() unless you’re interested in obtaining DST info separately. For example, datetime.timetuple(

multiprocessing.pool.Pool.imap()

imap(func, iterable[, chunksize]) A lazier version of map(). The chunksize argument is the same as the one used by the map() method. For very long iterables using a large value for chunksize can make the job complete much faster than using the default value of 1. Also if chunksize is 1 then the next() method of the iterator returned by the imap() method has an optional timeout parameter: next(timeout) will raise multiprocessing.TimeoutError if the result cannot be returned within timeout sec

ssl.get_server_certificate()

ssl.get_server_certificate(addr, ssl_version=PROTOCOL_SSLv23, ca_certs=None) Given the address addr of an SSL-protected server, as a (hostname, port-number) pair, fetches the server’s certificate, and returns it as a PEM-encoded string. If ssl_version is specified, uses that version of the SSL protocol to attempt to connect to the server. If ca_certs is specified, it should be a file containing a list of root certificates, the same format as used for the same parameter in wrap_socket(). The

test.support.import_fresh_module()

test.support.import_fresh_module(name, fresh=(), blocked=(), deprecated=False) This function imports and returns a fresh copy of the named Python module by removing the named module from sys.modules before doing the import. Note that unlike reload(), the original module is not affected by this operation. fresh is an iterable of additional module names that are also removed from the sys.modules cache before doing the import. blocked is an iterable of module names that are replaced with None i

operator.__contains__()

operator.__contains__(a, b) Return the outcome of the test b in a. Note the reversed operands.