Message395999
I was thinking about something like:
@dataclass
class FtpHelper(ftplib.FTP):
my_host: str
my_user: str
lookup_password: InitVar[Callable]
def __post_init__(self, lookup_password):
super().__init__(host=self.my_host, user=self.my_user, passwd=lookup_password())
def get_password():
return "a password"
ftp = FtpHelper(hostname, username, get_password) |
|
Date |
User |
Action |
Args |
2021-06-17 12:22:06 | eric.smith | set | recipients:
+ eric.smith, docs@python, andrei.avk, MicaelJarniac |
2021-06-17 12:22:06 | eric.smith | set | messageid: <1623932526.44.0.997093061472.issue44365@roundup.psfhosted.org> |
2021-06-17 12:22:06 | eric.smith | link | issue44365 messages |
2021-06-17 12:22:06 | eric.smith | create | |
|