weakref.WeakKeyDictionary

class weakref.WeakKeyDictionary([dict]) Mapping class that references keys weakly. Entries in the dictionary will be discarded when there is no longer a strong reference to the key. This can be used to associate additional data with an object owned by other parts of an application without adding attributes to those objects. This can be especially useful with objects that override attribute accesses. Note Caution: Because a WeakKeyDictionary is built on top of a Python dictionary, it must no

asyncio.LifoQueue

class asyncio.LifoQueue A subclass of Queue that retrieves most recently added entries first.

ipaddress.v4_int_to_packed()

ipaddress.v4_int_to_packed(address) Represent an address as 4 packed bytes in network (big-endian) order. address is an integer representation of an IPv4 IP address. A ValueError is raised if the integer is negative or too large to be an IPv4 IP address. >>> ipaddress.ip_address(3221225985) IPv4Address('192.0.2.1') >>> ipaddress.v4_int_to_packed(3221225985) b'\xc0\x00\x02\x01'

tempfile.mktemp()

tempfile.mktemp(suffix='', prefix='tmp', dir=None) Deprecated since version 2.3: Use mkstemp() instead. Return an absolute pathname of a file that did not exist at the time the call is made. The prefix, suffix, and dir arguments are similar to those of mkstemp(), except that bytes file names, suffix=None and prefix=None are not supported. Warning Use of this function may introduce a security hole in your program. By the time you get around to doing anything with the file name it returns,

collections.Counter

class collections.Counter([iterable-or-mapping]) A Counter is a dict subclass for counting hashable objects. It is an unordered collection where elements are stored as dictionary keys and their counts are stored as dictionary values. Counts are allowed to be any integer value including zero or negative counts. The Counter class is similar to bags or multisets in other languages. Elements are counted from an iterable or initialized from another mapping (or counter): >>> c = Counter()

socket.socket.setsockopt()

socket.setsockopt(level, optname, value) Set the value of the given socket option (see the Unix manual page setsockopt(2)). The needed symbolic constants are defined in the socket module (SO_* etc.). The value can be an integer or a bytes-like object representing a buffer. In the latter case it is up to the caller to ensure that the bytestring contains the proper bits (see the optional built-in module struct for a way to encode C structures as bytestrings). Changed in version 3.5: Writable

xml.parsers.expat.xmlparser.SetParamEntityParsing()

xmlparser.SetParamEntityParsing(flag) Control parsing of parameter entities (including the external DTD subset). Possible flag values are XML_PARAM_ENTITY_PARSING_NEVER, XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE and XML_PARAM_ENTITY_PARSING_ALWAYS. Return true if setting the flag was successful.

xml.dom.Element.removeAttributeNode()

Element.removeAttributeNode(oldAttr) Remove and return oldAttr from the attribute list, if present. If oldAttr is not present, NotFoundErr is raised.

datetime.datetime.combine()

classmethod datetime.combine(date, time) Return a new datetime object whose date components are equal to the given date object’s, and whose time components and tzinfo attributes are equal to the given time object’s. For any datetime object d, d == datetime.combine(d.date(), d.timetz()). If date is a datetime object, its time components and tzinfo attributes are ignored.

sys.getwindowsversion()

sys.getwindowsversion() Return a named tuple describing the Windows version currently running. The named elements are major, minor, build, platform, service_pack, service_pack_minor, service_pack_major, suite_mask, and product_type. service_pack contains a string while all other values are integers. The components can also be accessed by name, so sys.getwindowsversion()[0] is equivalent to sys.getwindowsversion().major. For compatibility with prior versions, only the first 5 elements are ret