email.header.decode_header()

email.header.decode_header(header) Decode a message header value without converting the character set. The header value is in header. This function returns a list of (decoded_string, charset) pairs containing each of the decoded parts of the header. charset is None for non-encoded parts of the header, otherwise a lower case string containing the name of the character set specified in the encoded string. Here’s an example: >>> from email.header import decode_header >>> decod

asyncio.WriteTransport.write()

write(data) Write some data bytes to the transport. This method does not block; it buffers the data and arranges for it to be sent out asynchronously.

smtpd.SMTPChannel.smtp_state

smtp_state Holds the current state of the channel. This will be either COMMAND initially and then DATA after the client sends a “DATA” line.

typing.NamedTuple()

typing.NamedTuple(typename, fields) Typed version of namedtuple. Usage: Employee = typing.NamedTuple('Employee', [('name', str), ('id', int)]) This is equivalent to: Employee = collections.namedtuple('Employee', ['name', 'id']) The resulting class has one extra attribute: _field_types, giving a dict mapping field names to types. (The field names are in the _fields attribute, which is part of the namedtuple API.)

os.extsep

os.extsep The character which separates the base filename from the extension; for example, the '.' in os.py. Also available via os.path.

unittest.TestCase.assertGreaterEqual()

assertGreaterEqual(first, second, msg=None) assertLess(first, second, msg=None) assertLessEqual(first, second, msg=None) Test that first is respectively >, >=, < or <= than second depending on the method name. If not, the test will fail: >>> self.assertGreaterEqual(3, 4) AssertionError: "3" unexpectedly not greater than or equal to "4" New in version 3.1.

nntplib.NNTP.next()

NNTP.next() Send a NEXT command. Return as for stat().

asyncio.Future.cancelled()

cancelled() Return True if the future was cancelled.

sqlite3.Connection.executescript()

executescript(sql_script) This is a nonstandard shortcut that creates a cursor object by calling the cursor() method, calls the cursor’s executescript() method with the given sql_script, and returns the cursor.

tkinter.ttk.Widget.instate()

instate(statespec, callback=None, *args, **kw) Test the widget’s state. If a callback is not specified, returns True if the widget state matches statespec and False otherwise. If callback is specified then it is called with args if widget state matches statespec.