Alexander Belopolsky <belopol...@users.sourceforge.net> added the comment:
On Mon, May 24, 2010 at 11:06 PM, Rafe Kaplan <rep...@bugs.python.org> wrote: .. > On 2, we had discussions about how to pass parameters in to utcnow that we > DID record. When I > suggested it, Brett said: > > "...using a boolean flag over an argument is much less error-prone for a > developer from passing in the wrong > timezone object; passing in something other than an instance of UTC would > just be stupid so we should make > sure the developer isn't stupid. =)" Well, I respectfully disagree. This advise seems to be placing convenience of the writer of the code over that of the reader. Imagine encountering an expression datetime.utcnow(True) allowed by your current patch and trying to figure out what it means. This can be improved by making tz_aware a keyword only argument, but in that case a separate datetime.tz_aware_utcnow() function seems like a better choice. Note that I am not suggesting passing anything to utcnow(). I would either leave it unchanged or make it always return aware datetime instances. (Note that with singleton UTC timezone naive datetime instances can be deprecated with no performance penalty.) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue5094> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com