[issue31804] multiprocessing calls flush on sys.stdout at exit even if it is None (pythonw)

2018-01-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: @Pox, nevertheless, the fix committed in https://github.com/python/cpython/pull/4073 should also fix this issue. Do you disagree? -- ___ Python tracker

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Paul Ganssle
Paul Ganssle added the comment: One thing to note, the "example implementation" of __round__ above is an actual working prototype*: >>> round(Datetime.now(), 'second') Datetime(2018, 1, 9, 11, 59, 35) >>> round(Datetime.now(), 'day') Datetime(2018, 1, 9, 0, 0) >>>

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Jan 9, 2018, at 08:33, Paul Ganssle wrote: > @Barry I don't think it's a good idea to duplicate the `replace` > functionality in `datetime` like that. I think the main problem isn't the > `.replace`, it's the

[issue32517] test_read_pty_output() of test_asyncio hangs on macOS 10.13.2 (darwin 17.3.0)

2018-01-09 Thread Matt Billenstein
Matt Billenstein added the comment: Note, I can repro running it by hand from the cli. And I cannot repro on 3.x, only 3.6 on the same machine. -- ___ Python tracker

[issue32493] UUID Module - FreeBSD build failure

2018-01-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: New changeset b4ebaa7099c3413b42a9581c4ca560fe7540 by Antoine Pitrou (David Carlier) in branch 'master': bpo-32493: Not only AIX, but FreeBSD has uuid_create support (#5089)

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > I think that a "truncate to rrule" function is *way* beyond the scope of the > standard library I agree and I did not propose that. What I said was that in the process of implementing truncate to rrule in dateutil you

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > replacing all elements of a datetime below a certain level is a very common > idiom This can be accomplished rather efficiently by truncating a time tuple: >>> t = datetime.now() >>> datetime(*t.timetuple()[:6])

[issue32493] UUID Module - FreeBSD build failure

2018-01-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thank you for the fix David! -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker

[issue32524] Python 2.7 leaks a packages __init__.py module object on SyntaxError

2018-01-09 Thread Segev Finer
New submission from Segev Finer : With the file hello/__init__.py: ham = 123 spam()spam() I get the following: Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license"

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am about +0 on adding a keyword argument to datetime.now. Note that as I wrote in issue 19475 (msg202242), "precision" may be a misleading name because python makes no guarantee about the precision of the computer

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Paul Ganssle
Paul Ganssle added the comment: > Looking at the dateutil, I don't see a truncate to rrule function. Maybe a > good starting point would be to implement that in dateutil and if some > simpler pattern emerges that can be proposed for stdlib, we can discuss it > then. I

[issue29640] _PyThreadState_Init and fork race leads to inconsistent key list

2018-01-09 Thread Petr Viktorin
Petr Viktorin added the comment: WIP pull request: https://github.com/python/cpython/pull/5141 (I'll not get back to this for a few days, sadly.) -- ___ Python tracker

[issue29640] _PyThreadState_Init and fork race leads to inconsistent key list

2018-01-09 Thread Petr Viktorin
Change by Petr Viktorin : -- pull_requests: +5000 stage: -> patch review ___ Python tracker ___

[issue24340] co_stacksize estimate can be highly off

2018-01-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset d4864c61e3e27e337762dc45e504977299bd5b46 by Serhiy Storchaka in branch 'master': bpo-24340: Fix estimation of the code stack size. (#5076)

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Paul Ganssle
Paul Ganssle added the comment: > This can be accomplished rather efficiently by truncating a time tuple: This will not preserve tzinfo, and (though this is not a concern unless nanosecond precision is added), I don't believe it preserves microseconds either. That said,

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Paul Ganssle
Paul Ganssle added the comment: I think if we're going to use `timedelta` then `__mod__` is the more appropriate option here, since it would be hard to interpret what `round(dt, timedelta(hours=2, microseconds=31))` would do. Either __mod__ or __round__ with `timedelta`

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: In my experience, when dealing with temporal data truncation (rounding towards -infinity) is more useful than any other form of rounding. See also issue 19475. -- ___ Python

[issue10496] Python startup should not require passwd entry

2018-01-09 Thread Melissa Chang
Change by Melissa Chang : -- nosy: -Melissa Chang ___ Python tracker ___ ___

[issue29640] _PyThreadState_Init and fork race leads to inconsistent key list

2018-01-09 Thread Petr Viktorin
Petr Viktorin added the comment: Gah! The more I look into locks & forks ... the more I learn, to put it mildly. Instead of piling on workarounds, I'll try my hand at using native thread-local storage for pthread, and avoid the locking altogether. Hopefully that can make

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Maybe __round__ can be generalized to take a timedelta instead of ndigits? For some related prior art, take a look at . -- ___

[issue28009] core logic of uuid.getnode() is broken for AIX - all versions

2018-01-09 Thread Michael Felt
Michael Felt added the comment: On 09/01/2018 16:21, Antoine Pitrou wrote: > Antoine Pitrou added the comment: > >> What is the desired behavior, specifically, of > uuid.getnode() - constant, or 'random'? > > I'm also certain getnode() is supposed to

[issue31804] multiprocessing calls flush on sys.stdout at exit even if it is None (pythonw)

2018-01-09 Thread Terry J. Reedy
Terry J. Reedy added the comment: Pox, please retest with either 3.6.4 or 3.7.0a3 (or .0a4 when released, soon). Both were released after the merge that should fix this. -- ___ Python tracker

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Paul Ganssle
Paul Ganssle added the comment: > In my experience, when dealing with temporal data truncation (rounding > towards -infinity) is more useful than any other form of rounding. See also > issue 19475. Ah, I agree - if you see that's how my __round__ implementation works. I

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The problem that I have with the round/truncate proposal is that it is not general enough. Days, hours, minutes etc. are just arbitrary intervals that became popular for obscure historical and astronomical reasons. In

[issue32007] nis module fails to build against glibc-2.26

2018-01-09 Thread Christian Heimes
Christian Heimes added the comment: #32521 is a duplicate of this issue. I didn't notice this issue when I created a fix. - I agree with Benjamin, let's deprecate the NIS module. NIS/YP functionality has been replaced by NSS a long time ago. - We have no infrastructure to

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > (And, honestly, `dateutil` would provide a version-independent backport > anyway). Why not start with that? Remember: python standard library is where code goes to die. By implementing this feature in dateutil you

[issue30121] Windows: subprocess debug assertion on failure to execute the process

2018-01-09 Thread Segev Finer
Change by Segev Finer : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.

2018-01-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 5143 is yet one alternative. It is a variant of PR 5006 that restores SETUP_EXCEPT and gets rid of the new opcode BEGIN_FINALLY. SETUP_FINALLY, SETUP_WITH and SETUP_ASYNC_WITH now push NULL on the stack instead. PR 5143

[issue30121] Windows: subprocess debug assertion on failure to execute the process

2018-01-09 Thread STINNER Victor
STINNER Victor added the comment: > Oops, I merged the pull requests, but I forgot to close the issue. Oops, I forgot to close the issue, again... Thanks Segev for closing it, finally :-) -- ___ Python tracker

[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.

2018-01-09 Thread Mark Shannon
Mark Shannon added the comment: Can we stick to the one PR, please? Once it is merged then we can improve things. Also, I don't like leaving NULLs on the stack, they are an invitation to seg-fault. PR 5143 leaves more NULLs on the stack for longer. --

[issue32267] strptime misparses offsets with microsecond format

2018-01-09 Thread Alexander Belopolsky
Change by Alexander Belopolsky : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.

2018-01-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +5002 ___ Python tracker ___ ___

[issue32525] Empty tuples are not optimized as constant expressions

2018-01-09 Thread benrg
New submission from benrg : >From 3.3 on, the expression () is compiled to BUILD_TUPLE 0 instead of >LOAD_CONST. That's probably fine and I suppose it's slightly more efficient to >avoid adding an entry to the constant table. The problem is that BUILD_TUPLE 0 is not

[issue16462] smtpd should return greeting

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm closing this as won't fix since smtpd.py is deprecated and likely won't see any fixes. Please take a look at aiosmtpd as a much better third party replacement. -- resolution: -> wont fix stage: -> resolved status: open ->

[issue19678] smtpd.py: channel should be passed to process_message

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm going to close this as won't fix since smtpd.py is deprecated, and there's little chance that folks are still interested in working on it. See aiosmtpd as a much better third party replacement. -- resolution: -> wont fix

[issue19679] smtpd.py (SMTPChannel): implement enhanced status codes

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm closing this as won't fix since smtpd.py is deprecated and will likely not get any future development. Please see aiosmtpd as a much better third party replacement. -- resolution: -> wont fix stage: -> resolved status: open

[issue2518] smtpd.py to handle huge email

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm closing this as won't fix since smtpd.py is deprecated and will likely not get any future development. Please see aiosmtpd as a much better third party replacement. -- resolution: -> wont fix stage: test needed -> resolved

[issue3802] smtpd.py __getaddr insufficient handling

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm closing this as won't fix since smtpd.py is deprecated and will likely not get any future development. Please see aiosmtpd as a much better third party replacement. -- nosy: +barry resolution: -> wont fix stage: test needed

[issue8503] smtpd SMTPServer does not allow domain filtering

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm closing this as won't fix since smtpd.py is deprecated and will likely not get any future development. Please see aiosmtpd as a much better third party replacement. -- resolution: -> wont fix stage: test needed -> resolved

[issue14261] Cleanup in smtpd module

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm closing this as won't fix since smtpd.py is deprecated and will likely not get any future development. Please see aiosmtpd as a much better third party replacement. -- nosy: +barry resolution: -> wont fix stage: needs patch

[issue12815] Coverage of smtpd.py

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: smtpd.py is deprecated so there's really almost zero chance we'll be doing any development on it. Please check out http://aiosmtpd.readthedocs.io/en/latest/ for a third party replacement (maybe pulled into the stdlib for 3.8?)

[issue26036] Unnecessary arguments on smtpd.SMTPServer

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm closing this as won't fix simce smtpd.py is deprecated and likely won't see any future improvements. Please take a look at aiosmtpd as a much better third party replacement. -- resolution: -> wont fix stage: -> resolved

[issue25553] smtpd strips final carraige return from received message body

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm closing this as won't fix since smtpd.py is deprecated and likely won't see much future improvements. Please take a look at aiosmtpd as a much better third party replacement. -- resolution: -> wont fix stage: needs patch ->

[issue11260] smtpd-as-a-script feature should be documented and should use argparse

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm closing this as won't fix since smtpd.py is deprecated and will likely not get any future development. Please see aiosmtpd as a much better third party replacement. -- resolution: -> wont fix stage: patch review -> resolved

[issue22071] Remove long-time deprecated attributes from smtpd

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm closing this as won't fix since smtpd.py is deprecated and will likely not get any future development. Please see aiosmtpd as a much better third party replacement. -- nosy: +barry resolution: -> wont fix stage: patch review

[issue19806] smtpd crashes when a multi-byte UTF-8 sequence is split between consecutive data packets

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm closing this as won't fix since smtpd.py is deprecated and will likely not get any future development. Please see aiosmtpd as a much better third party replacement. -- nosy: +barry resolution: -> wont fix stage: patch review

[issue22159] smtpd.PureProxy and smtpd.DebuggingServer do not work with decode_data=True

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm closing this as won't fix since smtpd.py is deprecated and will likely not get any future development. Please see aiosmtpd as a much better third party replacement. -- nosy: +barry resolution: -> wont fix stage: -> resolved

[issue22158] RFC 6531 (SMTPUTF8) support in smtpd.PureProxy

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm closing this as won't fix since smtpd.py is deprecated and will likely not get any future development. Please see aiosmtpd as a much better third party replacement. -- nosy: +barry resolution: -> wont fix stage: -> resolved

[issue12816] smtpd uses library outside of the standard libraries

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm closing this as won't fix since smtpd.py is deprecated and will likely not get any future development. Please see aiosmtpd as a much better third party replacement. -- resolution: -> wont fix stage: -> resolved status: open

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Paul Ganssle
Paul Ganssle added the comment: > Still, this feature is not appealing enough to try to squeeze into 3.7 > release schedule. I think this should go through a round of discussion > either on datetime-sig or python-ideas. Agreed. I will put together some summary in the

[issue32524] Python 2.7 leaks a packages __init__.py module object on SyntaxError

2018-01-09 Thread Segev Finer
Change by Segev Finer : -- keywords: +patch pull_requests: +5001 stage: -> patch review ___ Python tracker ___

[issue32459] Capsule API usage docs are incompatible with module reloading (etc)

2018-01-09 Thread Petr Viktorin
Change by Petr Viktorin : -- nosy: +Dormouse759, encukou ___ Python tracker ___ ___

[issue32507] Change Windows install to applocal UCRT

2018-01-09 Thread Steve Dower
Steve Dower added the comment: Missed the a4 cutoff, but it'll be in 3.7.0b1. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue24459] Mention PYTHONFAULTHANDLER in the man page

2018-01-09 Thread Anant Prakash
Anant Prakash added the comment: I am going to take the patch, edit and make a github PR for this. Any updates on this issue are welcome. Thank you -- nosy: +Anant Prakash ___ Python tracker

[issue30782] Allow limiting the number of concurrent tasks in asyncio.as_completed

2018-01-09 Thread Andy Balaam
Andy Balaam added the comment: I would argue that this makes as_completed a lot more useful than it is now, so would be worth adding (maybe after 3.7). But, if this does not go into asyncio, is there another library where it would belong? Or should this be a

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2018-01-09 Thread Eric V. Smith
Eric V. Smith added the comment: I tend to agree with you about pre-scanning the arguments to find options. But at this point, our options to change the code are limited. The last time I looked at this (and it's been years), I came to the conclusion that the argument

[issue32507] Change Windows install to applocal UCRT

2018-01-09 Thread Steve Dower
Steve Dower added the comment: New changeset d135f20ae8887acc7716561bc8f4c7eb6d58d24c by Steve Dower in branch 'master': bpo-32507: Change Windows install to include app-local UCRT (#5119)

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2018-01-09 Thread Tom Karzes
Tom Karzes added the comment: Here's my situation: I originally used optparse, although some of the guys I worked with at the time were starting to use argparse. At first I thought, I'm sticking with optparse, it's more standard than argparse and probably better

[issue32517] test_read_pty_output() of test_asyncio hangs on macOS 10.13.2 (darwin 17.3.0)

2018-01-09 Thread Matt Billenstein
Matt Billenstein added the comment: I don't see a conflict in the uids: mattb@mattb-mbp2:~ $ id -u buildbot 506 mattb@mattb-mbp2:~ $ id -u _timed 266 mattb@mattb-mbp2:~ $ grep _timed /etc/passwd _timed:*:266:266:Time Sync Daemon:/var/db/timed:/usr/bin/false mattb@mattb-mbp2:~ $

[issue32518] HTTPServer can't deal with persistent connection properly

2018-01-09 Thread R. David Murray
R. David Murray added the comment: In particular, if we don't already have an example of using the threading mixin we should, so a doc RFE to add that would be nice. -- ___ Python tracker

[issue32518] HTTPServer can't deal with persistent connection properly

2018-01-09 Thread R. David Murray
R. David Murray added the comment: Well, it does support a persistent connection, but that connection lasts until it is shut down from the other side. Documentation improvement suggestions are welcome. -- ___ Python tracker

[issue32430] Simplify Modules/Setup{,.dist,.local}

2018-01-09 Thread Thomas Wouters
Thomas Wouters added the comment: We do use Setup/Setup.local at Google (and have for many years now), and I find it very useful. (FWIW, the 'we would use' comment in msg294174 was about the new '*disabled*' feature, not about Setup files in general.) Avoiding local

[issue24459] Mention PYTHONFAULTHANDLER in the man page

2018-01-09 Thread Anant Prakash
Anant Prakash added the comment: Ignore my previous comment. My bad. -- ___ Python tracker ___

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Paul Ganssle
New submission from Paul Ganssle : One thing I think that is fairly common is the desire to get the current datetime only up to a current precision, so you see a lot of things in, say, `dateutil` like this: dt = datetime.now().replace(hours=0, minutes=0, seconds=0,

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread STINNER Victor
STINNER Victor added the comment: > dt = datetime.now(precision='day') Why not creating a date and then convert it to a datetime object? > dt = datetime.now().replace(microseconds=0) Yeah, that one annoys me as well, but I learnt the .replace(microseconds=0) hack,

[issue29640] _PyThreadState_Init and fork race leads to inconsistent key list

2018-01-09 Thread STINNER Victor
STINNER Victor added the comment: There is a more general issue for any lock and fork(): bpo-6721, "Locks in the standard library should be sanitized on fork". -- ___ Python tracker

[issue32374] Document that m_traverse for multi-phase initialized modules can be called with m_state=NULL

2018-01-09 Thread Marcel Plch
Change by Marcel Plch : -- pull_requests: +4999 ___ Python tracker ___ ___

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Paul Ganssle
Paul Ganssle added the comment: An alternate possibility here might be to implement either `__round__` or a `round` function in `datetime` (which would basically automatically add this precision functionality to *all* the constructors, not just now). An example

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Paul Ganssle
Paul Ganssle added the comment: @Victor: With regards to getting a "date as datetime", that is another way to do it that I have also done in the past (and in fact it's how the new dateutil.utils.today() function is implemented:

[issue31804] multiprocessing calls flush on sys.stdout at exit even if it is None (pythonw)

2018-01-09 Thread Pox TheGreat
Pox TheGreat added the comment: Unfortunately this is NOT a duplicate of https://bugs.python.org/issue28326. That issue is about a closed output stream. In that case sys.stdout and sys.stderr are file like objects which have been closed. This issue is about sys.stdout

[issue32374] Document that m_traverse for multi-phase initialized modules can be called with m_state=NULL

2018-01-09 Thread Marcel Plch
Marcel Plch added the comment: I have created a PR at https://github.com/python/cpython/pull/5140 It contains documentation, plus, in --with-pydebug mode, it calls m_traverse to catch easy cases of not handling the m_state==NULL case early. --

[issue29640] _PyThreadState_Init and fork race leads to inconsistent key list

2018-01-09 Thread Petr Viktorin
Petr Viktorin added the comment: I'm a bit out of my depth here. Victor, could you chime in? The problem with Harris' patch is that, once fork() is protected by the thread lock, acquiring that lock (by e.g. calling `PyGILState_GetThisThreadState`) from an `atfork` handler

[issue32493] UUID Module - FreeBSD build failure

2018-01-09 Thread David Carlier
David Carlier added the comment: I guessed that :-) I trusted it worked just fine for you. To be honest I know nearly nothing about AIX specificities :-) -- ___ Python tracker

[issue28009] core logic of uuid.getnode() is broken for AIX - all versions

2018-01-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: > What is the desired behavior, specifically, of uuid.getnode() - constant, or 'random'? I'm also certain getnode() is supposed to return a hardware-determined number (usually the MAC address of an Ethernet interface). A random output

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Paul Ganssle
Change by Paul Ganssle : -- type: -> enhancement ___ Python tracker ___ ___

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Barry A. Warsaw
Change by Barry A. Warsaw : -- nosy: +barry ___ Python tracker ___ ___ Python-bugs-list

[issue32523] inconsistent spacing in changelog.html

2018-01-09 Thread Ned Deily
New submission from Ned Deily : The rendered changelog.html files produced "make html" have inconsistent spacing between items. Usually, the first changelog topic section (e.g. Security) starts with no blank lines between items but occasionally some subsequent sections will

[issue29640] _PyThreadState_Init and fork race leads to inconsistent key list

2018-01-09 Thread STINNER Victor
STINNER Victor added the comment: Python 3 is not affected by this issue because it uses native thread locale storage (TLS): * pthread: pthread_getspecific() / pthread_setspecific() * Windows: TlsGetValue() / TlsSetValue() I'm not sure that it's doable to backport

[issue32523] inconsistent spacing in changelog.html

2018-01-09 Thread Ned Deily
Ned Deily added the comment: See also discussion at https://github.com/python/core-workflow/issues/209 -- ___ Python tracker ___

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: The .replace(microseconds=0) hack annoys me too, but I'd be happier with a simpler solution: make datetime.now() accept a microseconds parameter, so datetime.now(microseconds=0) would be equivalent to datetime.now().replace(microseconds=0)

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Paul Ganssle
Paul Ganssle added the comment: @Barry I don't think it's a good idea to duplicate the `replace` functionality in `datetime` like that. I think the main problem isn't the `.replace`, it's the fact that you have to specify exactly which components you want to set to zero