mimetypes.MimeTypes.suffix_map

MimeTypes.suffix_map Dictionary mapping suffixes to suffixes. This is used to allow recognition of encoded files for which the encoding and the type are indicated by the same extension. For example, the .tgz extension is mapped to .tar.gz to allow the encoding and type to be recognized separately. This is initially a copy of the global suffix_map defined in the module.

reprlib.repr()

reprlib.repr(obj) This is the repr() method of aRepr. It returns a string similar to that returned by the built-in function of the same name, but with limits on most sizes.

types.MappingProxyType.get()

get(key[, default]) Return the value for key if key is in the underlying mapping, else default. If default is not given, it defaults to None, so that this method never raises a KeyError.

turtle.exitonclick()

turtle.exitonclick() Bind bye() method to mouse clicks on the Screen. If the value “using_IDLE” in the configuration dictionary is False (default value), also enter mainloop. Remark: If IDLE with the -n switch (no subprocess) is used, this value should be set to True in turtle.cfg. In this case IDLE’s own mainloop is active also for the client script.

xml.dom.Element.setAttribute()

Element.setAttribute(name, value) Set an attribute value from a string.

unittest.mock.Mock.called

called A boolean representing whether or not the mock object has been called: >>> mock = Mock(return_value=None) >>> mock.called False >>> mock() >>> mock.called True

bisect.insort_left()

bisect.insort_left(a, x, lo=0, hi=len(a)) Insert x in a in sorted order. This is equivalent to a.insert(bisect.bisect_left(a, x, lo, hi), x) assuming that a is already sorted. Keep in mind that the O(log n) search is dominated by the slow O(n) insertion step.

weakref.ReferenceError

exception weakref.ReferenceError Exception raised when a proxy object is used but the underlying object has been collected. This is the same as the standard ReferenceError exception.

ctypes.set_errno()

ctypes.set_errno(value) Set the current value of the ctypes-private copy of the system errno variable in the calling thread to value and return the previous value.

email.parser.FeedParser.feed()

feed(data) Feed the FeedParser some more data. data should be a string containing one or more lines. The lines can be partial and the FeedParser will stitch such partial lines together properly. The lines in the string can have any of the common three line endings, carriage return, newline, or carriage return and newline (they can even be mixed).