functools.partial.args

partial.args The leftmost positional arguments that will be prepended to the positional arguments provided to a partial object call.

functools.partial()

functools.partial(func, *args, **keywords) Return a new partial object which when called will behave like func called with the positional arguments args and keyword arguments keywords. If more arguments are supplied to the call, they are appended to args. If additional keyword arguments are supplied, they extend and override keywords. Roughly equivalent to: def partial(func, *args, **keywords): def newfunc(*fargs, **fkeywords): newkeywords = keywords.copy() newkeywords.up

functools.lru_cache()

@functools.lru_cache(maxsize=128, typed=False) Decorator to wrap a function with a memoizing callable that saves up to the maxsize most recent calls. It can save time when an expensive or I/O bound function is periodically called with the same arguments. Since a dictionary is used to cache results, the positional and keyword arguments to the function must be hashable. If maxsize is set to None, the LRU feature is disabled and the cache can grow without bound. The LRU feature performs best wh

functools.cmp_to_key()

functools.cmp_to_key(func) Transform an old-style comparison function to a key function. Used with tools that accept key functions (such as sorted(), min(), max(), heapq.nlargest(), heapq.nsmallest(), itertools.groupby()). This function is primarily used as a transition tool for programs being converted from Python 2 which supported the use of comparison functions. A comparison function is any callable that accept two arguments, compares them, and returns a negative number for less-than, zer

ftplib.FTP_TLS.ssl_version

FTP_TLS.ssl_version The SSL version to use (defaults to ssl.PROTOCOL_SSLv23).

ftplib.FTP_TLS.prot_p()

FTP_TLS.prot_p() Set up secure data connection.

ftplib.FTP_TLS.prot_c()

FTP_TLS.prot_c() Set up clear text data connection.

ftplib.FTP_TLS.ccc()

FTP_TLS.ccc() Revert control channel back to plaintext. This can be useful to take advantage of firewalls that know how to handle NAT with non-secure FTP without opening fixed ports. New in version 3.3.

ftplib.FTP_TLS.auth()

FTP_TLS.auth() Set up a secure control connection by using TLS or SSL, depending on what is specified in the ssl_version attribute. Changed in version 3.4: The method now supports hostname check with ssl.SSLContext.check_hostname and Server Name Indication (see ssl.HAS_SNI).

ftplib.FTP_TLS

class ftplib.FTP_TLS(host='', user='', passwd='', acct='', keyfile=None, certfile=None, context=None, timeout=None, source_address=None) A FTP subclass which adds TLS support to FTP as described in RFC 4217. Connect as usual to port 21 implicitly securing the FTP control connection before authenticating. Securing the data connection requires the user to explicitly ask for it by calling the prot_p() method. context is a ssl.SSLContext object which allows bundling SSL configuration options, ce