[issue44770] float('nan') is True
New submission from Marty : I know that there is numpy.isnan() for checking if a value is float('nan') but I think that native python should logically return False in bool(float('nan')). -- messages: 398448 nosy: vpjtqwv0101 priority: normal severity: normal status: open title: float('nan') is True type: enhancement versions: Python 3.9 ___ Python tracker <https://bugs.python.org/issue44770> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44787] Missing valid directive %D in datetime.strftime() documentation
New submission from Marty : Output of: datetime.datetime.now().strftime('%D') is equivalent for: datetime.datetime.now().strftime('%m/%d/%y') Is there a reason that directive %D is missing in documentation? Are there other hidden directives? https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior -- messages: 398606 nosy: vpjtqwv0101 priority: normal severity: normal status: open title: Missing valid directive %D in datetime.strftime() documentation versions: Python 3.9 ___ Python tracker <https://bugs.python.org/issue44787> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44788] Possibility to specify port in __init__ of ftplib.FTP
New submission from Marty : I think all that's needed is to add new parameter port in __init__ and then add it to self.connect() as argument: def __init__(self, host='', port=0, user='', passwd='', acct='', timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=None, *, encoding='utf-8'): self.encoding = encoding self.source_address = source_address self.timeout = timeout if host: self.connect(host, port) if user: self.login(user, passwd, acct) Currently if I need to specify port, I have to do it like this: with FTP() as ftp: ftp.connect(host, port) ftp.login(user, password) # my actions I the port parameter would be added, I could use it like this: with FTP(host, port, user, password) as ftp: # my actions Thank you. -- components: Library (Lib) messages: 398611 nosy: vpjtqwv0101 priority: normal severity: normal status: open title: Possibility to specify port in __init__ of ftplib.FTP type: enhancement versions: Python 3.9 ___ Python tracker <https://bugs.python.org/issue44788> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44788] Possibility to specify port in __init__ of ftplib.FTP
Marty added the comment: Well, if it's possible to connect to ftp server within __init__, I think that adding port parameter makes sense. I mostly don't need to handle connect() and login() separately. All I need is to connect to ftp server and work with it. If there is some trouble with connection or login, the code still can't continue in this case. I haven't discussed this idea there. I'm going to create a topic for it and I will add the link here. -- ___ Python tracker <https://bugs.python.org/issue44788> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13135] Using type() as a constructor doesn't support new class keyword arguments
New submission from Marty Alchin : PEP 3115 introduced keyword arguments to class definitions and changed metaclasses to use them instead. Unfortunately, `type()` doesn't seem to have been updated to accept those keyword arguments as well. What this amounts to is that using `type()` as a constructor can no longer fully replicate the behavior of a class definition. Therefore, classes that use keyword arguments can't be created dynamically. I would attempt a patch, but I don't have a development environment capable of compiling Python, so I wouldn't have any chance to test it. -- messages: 145190 nosy: gulopine priority: normal severity: normal status: open title: Using type() as a constructor doesn't support new class keyword arguments type: feature request ___ Python tracker <http://bugs.python.org/issue13135> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13135] Using type() as a constructor doesn't support new class keyword arguments
Marty Alchin added the comment: Hrm, that does seem to satisfy the case I was immediately concerned with, but I was thinking there was another issue with it, but now I'm having trouble pinning down an example. I'll just assume I was getting ahead of myself. Thanks for the sanity lesson. -- ___ Python tracker <http://bugs.python.org/issue13135> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com