[issue20861] datetime argument handling inconsistent; should accept logical integers, not coercible values

2019-08-13 Thread STINNER Victor
STINNER Victor added the comment: This issue has been fixed in Python 3.3 by bpo-17576 which started to emit the DeprecationWarning. -- resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: -> PyNumber_Index() is not int-subclass friendly (or

[issue20861] datetime argument handling inconsistent; should accept logical integers, not coercible values

2019-08-13 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: This is essentially a duplicate of #36048. The example is now deprecated: >>> from decimal import Decimal >>> from datetime import datetime >>> datetime(Decimal("2000.5"), 1, 2) :1: DeprecationWarning: an integer is required (got type decimal.Decimal).

[issue20861] datetime argument handling inconsistent; should accept logical integers, not coercible values

2019-08-13 Thread STINNER Victor
STINNER Victor added the comment: See also bpo-35707. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue20861] datetime argument handling inconsistent; should accept logical integers, not coercible values

2019-08-13 Thread Joannah Nanjekye
Change by Joannah Nanjekye : -- nosy: +vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue20861] datetime argument handling inconsistent; should accept logical integers, not coercible values

2019-08-13 Thread Joannah Nanjekye
Joannah Nanjekye added the comment: Could be related to some discussions in this PR: https://github.com/python/cpython/pull/14842 -- ___ Python tracker ___

[issue20861] datetime argument handling inconsistent; should accept logical integers, not coercible values

2019-08-13 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +p-ganssle ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue20861] datetime argument handling inconsistent; should accept logical integers, not coercible values

2019-08-13 Thread Joannah Nanjekye
Change by Joannah Nanjekye : -- nosy: +nanjekyejoannah ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue20861] datetime argument handling inconsistent; should accept logical integers, not coercible values

2014-03-06 Thread Josh Rosenberg
New submission from Josh Rosenberg: Per my comments on #20858, datetime's argument handling is inconsistent. By using the 'i' format code, non-integer types are being coerced to int, even as other equivalent non-integer types are accepted (sometimes in a lossy fashion). Example: from

[issue20861] datetime argument handling inconsistent; should accept logical integers, not coercible values

2014-03-06 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- nosy: +belopolsky, lemburg, tim.peters ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20861 ___ ___

[issue20861] datetime argument handling inconsistent; should accept logical integers, not coercible values

2014-03-06 Thread Brian Kearns
Changes by Brian Kearns bdkea...@gmail.com: -- nosy: +bdkearns ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20861 ___ ___ Python-bugs-list

[issue20861] datetime argument handling inconsistent; should accept logical integers, not coercible values

2014-03-06 Thread Alexander Belopolsky
Changes by Alexander Belopolsky alexander.belopol...@gmail.com: -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20861 ___

[issue20861] datetime argument handling inconsistent; should accept logical integers, not coercible values

2014-03-06 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I'd appreciate any pointers on how to get started You probably know that the relevant code is in http://hg.python.org/cpython/file/47f37a688c4c/Modules/_datetimemodule.c#l4059 The devguide should get you started: http://docs.python.org/devguide/

[issue20861] datetime argument handling inconsistent; should accept logical integers, not coercible values

2014-03-06 Thread Josh Rosenberg
Josh Rosenberg added the comment: Thank you very much. Very helpful. I'll see about whipping up a preliminary patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20861 ___