[issue41904] datetime.datetime.today makes no sense and should be removed

2020-10-14 Thread Damian Yurzola
Damian Yurzola added the comment: Sorry I got my "current" wrong and I can't find the edit button Here again: > "How long is it until Christmas?" # Current implementation In [23]: datetime.datetime(2020, 12, 25) - datetime.datetime.today() Out[23]: datetime.timedelta

[issue41904] datetime.datetime.today makes no sense and should be removed

2020-10-14 Thread Damian Yurzola
Damian Yurzola added the comment: It took me a while to collect my thoughts but here you go. Advanced users don't have a problem. They'll trade in date or datetime objects explicitly. The "proof" is I could not find any github repo with more than one start that'll call date

[issue41904] datetime.datetime.today makes no sense and should be removed

2020-10-13 Thread Damian Yurzola
Damian Yurzola added the comment: I searched all of github and there seem to be ~350K entries for datetime.today I think this supports steven.daprano point against removal. I could not spot any major library in a quick cursory look. However I do see many calls that look a lot like

[issue41904] datetime.datetime.today makes no sense and should be removed

2020-10-01 Thread Damian Yurzola
Damian Yurzola added the comment: Thanks for your prompt answer Steven. I was inspired to file this bug after reading through a multiplicity of bugs introduced by folks confused by the library's behavior. So there's good precedent. While granted, the documentation is explicit

[issue41904] datetime.datetime.today makes no sense and should be removed

2020-10-01 Thread Damian Yurzola
New submission from Damian Yurzola : Last night I discovered we have datetime.datetime.today alongside datetime.datetime.now and datetime.date.today. - datetime.now - date.today Both make semantic sense. datetime.datetime.today returns a datetime, which make no semantic sense and causes

[issue40033] Just defined class missing from scope

2020-03-23 Thread Damian Yurzola
Change by Damian Yurzola : -- versions: +Python 3.7 ___ Python tracker <https://bugs.python.org/issue40033> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40033] Just defined class missing from scope

2020-03-21 Thread Damian Yurzola
Damian Yurzola added the comment: This is even a better example: Level1A is available to inherit from, but not to type with. Example: from typing import List class Level0A: pass class Level0B: class Level1A: pass class Level1B(Level1A): pass class

[issue40033] Just defined class missing from scope

2020-03-21 Thread Damian Yurzola
New submission from Damian Yurzola : In the following example the last line throws as 'NameError: name 'Level1A' is not defined' for both 3.7 and 3.8 I assumed that Level1A should already be in scope while defining the insides of Level1B. But it isn't. Is this a bug, or am I missing

[issue37742] logging.getLogger accepts name='root' leading to confusion

2019-08-01 Thread Damian Yurzola
New submission from Damian Yurzola : 'root' should be a reserved name to avoid this: >>> import logging >>> a = logging.getLogger() >>> b = logging.getLogger('root') >>> a.name 'root' >>> b.name 'root' >>> a is b False -- component