Alexander Belopolsky <belopol...@users.sourceforge.net> added the comment:
On Thu, Jun 3, 2010 at 3:15 PM, Brett Cannon <rep...@bugs.python.org> wrote: .. > As for the float/int argument, I personally am wary of it. Since the > timedelta constructor accepts hours as a keyword argument, I don't > see the benefit of having to support both timedeltas and int/floats. To my taste, timedelta(hours=-5) is just too verbose. It also forces you to import timedelta in a module that may otherwise not need it. > And I can see someone messing up and putting in a float that is not > > perfectly representable and getting upset at odd behavior. Since timedelta accepts floats for hours, this argument does not really hold. Also, with timedelta correctly rounding to the nearest microsecond, it is really hard to mess up with binary vs. decimal representation. > I say keep it simple and just accept timedeltas for now. If there > really is demand for accepting integers in the constructor than it can > be > added without backwards-compatibility issues. Better to keep the > API small > and expand later than make it too big to start and being > burdened with extraneous API stuff. > This a valid argument. since it is easier to remove code than to add, I'll keep int/float support in the patch while we are discussing the design, but I am ready to remove it. ---------- _______________________________________ 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