MCPcopy Index your code
hub / github.com/python/cpython / __init__

Method __init__

Lib/ftplib.py:109–123  ·  view source on GitHub ↗

Initialization method (called by class instantiation). Initialize host to localhost, port to standard ftp port. Optional arguments are host (for connect()), and user, passwd, acct (for login()).

(self, host='', user='', passwd='', acct='',
                 timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=None, *,
                 encoding='utf-8')

Source from the content-addressed store, hash-verified

107 trust_server_pasv_ipv4_address = False
108
109 def __init__(self, host='', user='', passwd='', acct='',
110 timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=None, *,
111 encoding='utf-8'):
112 """Initialization method (called by class instantiation).
113 Initialize host to localhost, port to standard ftp port.
114 Optional arguments are host (for connect()),
115 and user, passwd, acct (for login()).
116 """
117 self.encoding = encoding
118 self.source_address = source_address
119 self.timeout = timeout
120 if host:
121 self.connect(host)
122 if user:
123 self.login(user, passwd, acct)
124
125 def __enter__(self):
126 return self

Callers 1

__init__Method · 0.45

Calls 2

connectMethod · 0.95
loginMethod · 0.95

Tested by

no test coverage detected