[Python-ideas] Re: Create a @deprecated decorator (annotation)

2021-07-31 Thread Felipe Rodrigues
Recently I needed to do just that on an API and went with the decorator approach. Having this on the stdlib would be nice, and we can make it more powerful than just raising a warning. For instance, we could attach a `deprecated = True` to the function object so that framework authors can use that

[Python-ideas] Re: Create a @deprecated decorator (annotation)

2021-07-31 Thread Oscar Benjamin
On Thu, 29 Jul 2021 at 16:00, Paul Moore wrote: > > On Thu, 29 Jul 2021 at 15:39, Leonardo Freua > wrote: > > > > Would it be interesting to create a @deprecated decorator to avoid adding > > warnings.warn("deprecation message", DeprecationWarning, stacklevel=2) in > > methods body? > > I don't

[Python-ideas] Possibility to specify port in __init__ of ftplib.FTP

2021-07-31 Thread Marty
Hi. If there is possible to connect and login to ftp server within __init__, I think it would make sense to add parameter **port** in ftplib.FTP. It could look like this: ``` def __init__(self, host='', port=0, user='', passwd='', acct='', timeout=_GLOBAL_DEFAULT_TIMEOUT, so

[Python-ideas] Possibility to specify port in __init__ of ftplib.FTP

2021-07-31 Thread Stephen J. Turnbull
Marty writes: > If there is possible to connect and login to ftp server within > __init__, I think it would make sense to add parameter **port** in > ftplib.FTP. It could look like this: > ``` > def __init__(self, host='', port=0, user='', passwd='', acct='', > timeout=