[issue15873] datetime: add ability to parse RFC 3339 dates and times

2017-12-04 Thread Alexander Belopolsky
Alexander Belopolsky <alexander.belopol...@gmail.com> added the comment: The better is the enemy of the good here. Given the history of this issue, I would rather accept a well documented restrictive parser than wait for a more general code to be written. Note that we can always

[issue32195] datetime.strftime with %Y no longer outputs leading zeros

2017-12-01 Thread Alexander Belopolsky
Alexander Belopolsky <alexander.belopol...@gmail.com> added the comment: Isn't this a duplicate of issue 13305? -- status: pending -> open ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue31894] test_timestamp_naive failed on NetBSD

2017-10-29 Thread Alexander Belopolsky
Alexander Belopolsky <alexander.belopol...@gmail.com> added the comment: > The documentation only says “datetime.timestamp” calls “mktime” Indeed. See <https://docs.python.org/3/library/datetime.html#datetime.datetime.timestamp>. This is a documentation bug. Since 3.6 the

[issue31894] test_timestamp_naive failed on NetBSD

2017-10-29 Thread Alexander Belopolsky
Alexander Belopolsky <alexander.belopol...@gmail.com> added the comment: I am not sure. This is a system bug and we often provide work-arounds or even reimplementations of buggy time functions in the time and datetime modules. Whether or not this is something that is worth fixing is a qu

[issue31894] test_timestamp_naive failed on NetBSD

2017-10-29 Thread Alexander Belopolsky
Alexander Belopolsky <alexander.belopol...@gmail.com> added the comment: I posted a wrong command, but fortunately I am in New York, so it did not matter $ TZ=EST+05EDT,M3.2.0,M11.1.0 python -c 'import time;print(time.localtime(14400)[:])' (1969, 12, 31, 23, 0, 0, 2,

[issue31894] test_timestamp_naive failed on NetBSD

2017-10-29 Thread Alexander Belopolsky
Alexander Belopolsky <alexander.belopol...@gmail.com> added the comment: I hate this long form display! Next time please use time.localtime(14400)[:]. Do you agree that this is a system bug? On my Mac, I get $ python -c 'import time; print(time.localtime(14400)[:])' (1969, 12, 31, 23

[issue31894] test_timestamp_naive failed on NetBSD

2017-10-29 Thread Alexander Belopolsky
Alexander Belopolsky <alexander.belopol...@gmail.com> added the comment: I don't have access to NetBSD and this looks like a bug in the system implementation of localtime. The timestamp method is implemented by probing system localtime in the vicinity of UTC timestamp. Wha

[issue25729] update pure python datetime.timedelta creation

2017-10-26 Thread Alexander Belopolsky
Alexander Belopolsky <alexander.belopol...@gmail.com> added the comment: Brian, is this still relevant? If so, cab you submit a pull request? -- versions: +Python 3.7 -Python 3.6 ___ Python tracker <rep...@bugs.python.org> <https://

[issue28281] Remove year limits from calendar

2017-10-26 Thread Alexander Belopolsky
Alexander Belopolsky <alexander.belopol...@gmail.com> added the comment: New changeset 66c88ce30ca2b23daa37038e1a3c0de98f241f50 by Alexander Belopolsky in branch 'master': Closes bpo-28281: Remove year (1-) limits on the weekday() function. (#4109) https://github.com/python/cpython/

[issue31800] datetime.strptime: Support for parsing offsets with a colon

2017-10-25 Thread Alexander Belopolsky
Alexander Belopolsky <alexander.belopol...@gmail.com> added the comment: New changeset 32318930da70ff03320ec50813b843e7db6fbc2e by Alexander Belopolsky (Mario Corchero) in branch 'master': Closes bpo-31800: Support for colon when parsing time offsets (#4015) https://github.com/python/c

[issue24954] No way to generate or parse timezone as produced by datetime.isoformat()

2017-10-25 Thread Alexander Belopolsky
Alexander Belopolsky <alexander.belopol...@gmail.com> added the comment: I am going to merge PR 4015 submitted for issue 31800. That issue asks to make %z strptime format accept offsets with : separators. Given that a similar feature has been added to glibc several years ago, I don

[issue31803] time.clock() should emit a DeprecationWarning

2017-10-25 Thread Alexander Belopolsky
Alexander Belopolsky <alexander.belopol...@gmail.com> added the comment: I would like to add my voice to MAL's objections. I was not aware of time.clock() depreciation before Victor brought this issue to my attention. time.clock() is a very well-known API eponymous to a venerable UNIX

[issue28281] Remove year limits from calendar

2017-10-24 Thread Alexander Belopolsky
Alexander Belopolsky <alexander.belopol...@gmail.com> added the comment: I submitted Mark's patch unchanged as PR 4109. If we don't hear from Mark, I will address my own comments and merge. -- ___ Python tracker <rep...@bugs.python.or

[issue28281] Remove year limits from calendar

2017-10-24 Thread Alexander Belopolsky
Change by Alexander Belopolsky <alexander.belopol...@gmail.com>: -- pull_requests: +4079 stage: commit review -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

2017-10-24 Thread Alexander Belopolsky
Alexander Belopolsky <alexander.belopol...@gmail.com> added the comment: New changeset fdd9b217c60b454ac6a82f02c8b0b551caeac88b by Alexander Belopolsky in branch 'master': Closes bpo-28292: Implemented Calendar.itermonthdays3() and itermonthdays4(). (#4079) https://github.com/python/c

[issue31800] datetime.strptime: Support for parsing offsets with a colon

2017-10-23 Thread Alexander Belopolsky
Alexander Belopolsky <alexander.belopol...@gmail.com> added the comment: Note that #5288 relaxed the whole number of minutes restriction on UTC offsets. Since the goal is to be able to parse the output of .isoformat(), I think %z should accept sub-minute offsets. -- nosy: +belo

[issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

2017-10-22 Thread Alexander Belopolsky
Alexander Belopolsky <alexander.belopol...@gmail.com> added the comment: I submitted PR 4079. Serhiy, please review the logic and if this matches what we discussed a year ago, I will add the docs and NEWS entries. -- ___ Python tracke

[issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

2017-10-22 Thread Alexander Belopolsky
Change by Alexander Belopolsky <alexander.belopol...@gmail.com>: -- keywords: +patch pull_requests: +4049 stage: needs patch -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

2017-10-22 Thread Alexander Belopolsky
Alexander Belopolsky <alexander.belopol...@gmail.com> added the comment: > 1. Raise OverflowError at both ends (revert issue15421patch). The method > becomes unusable for two extreme months. The issue 15421 patch was committed in 85710a40e7e9eab86060bedc3762

[issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

2017-10-22 Thread Alexander Belopolsky
Alexander Belopolsky <alexander.belopol...@gmail.com> added the comment: Let me look into this. It's been a while ... -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue31327] bug in dateutil\tz\tz.py

2017-10-11 Thread Alexander Belopolsky
Alexander Belopolsky <alexander.belopol...@gmail.com> added the comment: Is this similar to issue 29097? -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue31212] datetime: min date (0001-01-01 00:00:00) can't be converted to local timestamp

2017-08-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > It still seems like this shouldn't give an error (especially when the > timezone of the local machine is UTC) This is the part where I agree with you. I suspect the error in the UTC case is an artifact of PEP 495 fold calculations that r

[issue31212] datetime: min date (0001-01-01 00:00:00) can't be converted to local timestamp

2017-08-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: BTW, I was originally against introducing .timestamp() method and this issue illustrates why it is problematic: people use it without understanding what it does. If you want the distance between datetime.min and datetime(1970,1,1) in seconds - compute

[issue31212] datetime: min date (0001-01-01 00:00:00) can't be converted to local timestamp

2017-08-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: It your use case, the input "0001-01-01T00:00:00" was in what timezone? I suspect what you want is >>> datetime.min.replace(tzinfo=timezone.utc).timestamp() -62135596800.0 And not -62135658000.0. If you work with naive date

[issue31212] datetime: min date (0001-01-01 00:00:00) can't be converted to local timestamp

2017-08-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On the second thought, a reasonable design can use datetime.min/max as placeholders for unknown times far in the past/future compensating for the lack datetime ±inf. In this use case, it may be annoying to see errors from timestamp() instead of some

[issue31212] datetime: min date (0001-01-01 00:00:00) can't be converted to local timestamp

2017-08-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The question is whether -62135658000.0 is the "correct" or even meaningful value: >>> datetime.utcfromtimestamp(-62135658000.0) Traceback (most recent call last): File "", line 1, in ValueError: year is out of range (

[issue5288] tzinfo objects with sub-minute offsets are not supported (e.g. UTC+05:53:28)

2017-07-31 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <alexander.belopol...@gmail.com>: -- resolution: -> fixed stage: test needed -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <http://b

[issue5288] tzinfo objects with sub-minute offsets are not supported (e.g. UTC+05:53:28)

2017-07-31 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: New changeset 018d353c1c8c87767d2335cd884017c2ce12e045 by Alexander Belopolsky in branch 'master': Closes issue bpo-5288: Allow tzinfo objects with sub-minute offsets. (#2896) https://github.com/python/cpython/commit

[issue5288] tzinfo objects with sub-minute offsets are not supported (e.g. UTC+05:53:28)

2017-07-28 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > My concern is that it makes timestamp parsing more complex To the contrary. The timezone field can now be parsed the same way as the time field plus the sign. -- ___ Python tracker <rep...@bugs.pyth

[issue5288] tzinfo objects with sub-minute offsets are not supported (e.g. UTC+05:53:28)

2017-07-28 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Victor, Tim called for removal of all restrictions on the offsets. See msg248468. I left the range restriction intact because we have some algorithms that rely on that, but in general I agree with Tim. There is nothing to be gained from restricting

[issue24954] No way to generate or parse timezone as produced by datetime.isoformat()

2017-07-27 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: John, An RFC3339 parser is beyond the scope of this issue which is limited to adding str[fp]time code(s) to produce and consume RFC3339-formatted timezones. We can still have fromisoformat() constructor implemented in 3.7, but someone needs to address

[issue5288] tzinfo objects with sub-minute offsets are not supported (e.g. UTC+05:53:28)

2017-07-27 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: In PR 2896, I've modified %z formatting code to output sub-minute data if present. I think %z parsing should be also modified to accept sub-minute data, but I would like to do it in the context of issue 24954. Thoughts

[issue5288] tzinfo objects with sub-minute offsets are not supported (e.g. UTC+05:53:28)

2017-07-26 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <alexander.belopol...@gmail.com>: -- assignee: -> belopolsky ___ Python tracker <rep...@bugs.python.org> <http://bugs.py

[issue5288] tzinfo objects with sub-minute offsets are not supported (e.g. UTC+05:53:28)

2017-07-26 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Most of the code supporting arbitrary offsets has already been committed. The only part left was to remove the checks and implement printing. -- ___ Python tracker <rep...@bugs.python.org>

[issue5288] tzinfo objects with sub-minute offsets are not supported (e.g. UTC+05:53:28)

2017-07-26 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <alexander.belopol...@gmail.com>: -- pull_requests: +2949 ___ Python tracker <rep...@bugs.python.org> <http://bugs.pytho

[issue5288] tzinfo objects with sub-minute offsets are not supported (e.g. UTC+05:53:28)

2017-07-26 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <alexander.belopol...@gmail.com>: -- priority: low -> versions: +Python 3.7 -Python 3.5 ___ Python tracker <rep...@bugs.python.org> <http://bugs.py

[issue5288] tzinfo objects with sub-minute offsets are not supported (e.g. UTC+05:53:28)

2017-07-26 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <alexander.belopol...@gmail.com>: -- nosy: +gvanrossum ___ Python tracker <rep...@bugs.python.org> <http://bugs.pytho

[issue24954] No way to generate or parse timezone as produced by datetime.isoformat()

2017-07-26 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: This issue is waiting for the final decision on #5288. If sub-minute offsets support is accepted, I still don't think we need %::z because %:z can simply add non-zero :seconds as needed. There are also some review comments on the latest patch

[issue30516] Documentation for datetime substract operation incorrect?

2017-07-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I agree. The documentation can be improved here. The note about x - y not being quite the same as x + (-y) belongs to the timedelta - timedelta operation. It should be removed from both date - timedelta and datetime-timedelta footnotes

[issue30822] Python implementation of datetime module is not being tested correctly.

2017-07-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > Why is it so slow? The tests enabled by "-utzdata" check UTC to local and back conversions at several points around *every* time transition in *every* timezone. On systems with a complete installation of IANA tzdata, this is a lot o

[issue30302] Improve .__repr__ implementation for datetime.timedelta

2017-07-02 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <alexander.belopol...@gmail.com>: -- nosy: +tim.peters ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue30302] Improve .__repr__ implementation for datetime.timedelta

2017-07-02 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Sorry for being late to the discussion, but please allow me to add a -1 vote. The time.struct_time precedent is indeed comically verbose. Whenever I need to inspect a struct_time, I cast it to a plain tuple Compare >>> time.gmtime(1

[issue29097] datetime.fromtimestamp(t) when 0 <= t <= 86399 fails on Python 3.6

2017-06-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > I just ran the following script to check if there are any folds from > timestamps [0, 86399] in any timezone. Ammar, I am not sure pytz timezones support PEP 495 conventions. Can you repeat your experiment using the latest dateu

[issue30443] datetime.datetime.__add__ does not respect fold.

2017-05-23 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The current behavior is intentional. Please see PEP 495 for details. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <http

[issue29956] math.exp documentation is misleading

2017-05-08 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <alexander.belopol...@gmail.com>: -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <http://bu

[issue28157] Document time module constants (timezone, tzname, etc.) as deprecated.

2017-04-01 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <alexander.belopol...@gmail.com>: -- keywords: -3.2regression ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue28157] Document time module constants (timezone, tzname, etc.) as deprecated.

2017-04-01 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > The datetime module .. Yes, the datetime module documentation can be improved, but let's keep this issue focused on the time module. Please open a new issue for the datetime module improveme

[issue28157] Document time module constants (timezone, tzname, etc.) as deprecated.

2017-04-01 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Cheryl, There is no need to apologize. I assigned this issue to myself when I created it because I had a few ideas about refactoring the time module documentation and thought I would get to it soon. As often happens other priorities interfered

[issue28157] Document time module constants (timezone, tzname, etc.) as deprecated.

2017-03-31 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: A question for Victor: Should we split the "Constants" section into "Clock ID constants" and "Timezone constants"? (See PR 928.) -- ___ Python tracker <rep...@bugs.py

[issue28157] Document time module constants (timezone, tzname, etc.) as deprecated.

2017-03-31 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The time and math modules are probably the oldest Python modules, but math have seen more development recently, so it should serve as a good model for how things should be organized. Yes, I believe re-listing module functions and constants

[issue29956] math.exp documentation is misleading

2017-03-31 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > This is because math.e is not the same as e. Right. That's why I think it would be nice to distinguish math.e and the base of the natural logarithm typographically in the docs. Can we use sphinx math mode? If not, I would use ita

[issue29956] math.exp documentation is misleading

2017-03-31 Thread Alexander Belopolsky
New submission from Alexander Belopolsky: The math.exp(x) function is documented to "Return e**x" <https://docs.python.org/3/library/math.html#math.exp>. This is misleading because even in the simplest case, math.exp(x) is not the same as math.e ** x: >>> import math

[issue29680] gdb/libpython.py does not work with gdb 7.2

2017-03-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: New changeset 661ca8843fed1183e38db06e52d59ac300bf1c2a by Lev Abalkin in branch 'master': Fixes bpo-29680: Older gdb does not have gdb.error. (#363) https://github.com/python/cpython/commit/661ca8843fed1183e38db06e52d59ac300bf1c2a

[issue28856] %b format for bytes does not support objects that follow the buffer protocol

2017-03-13 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: @xiang.zhang - I am the OP for this issue, so naturally I expect this to be fixed. I have a work-around in place for my own code, so I have no opinion on the particular versions. I guess the normal policy on bug fixes should apply

[issue9051] Improve pickle format for timezone aware datetime instances

2017-03-06 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <alexander.belopol...@gmail.com>: -- resolution: -> rejected stage: patch review -> resolved status: pending -> closed ___ Python tracker <rep...@bugs.python.org> <http://b

[issue29680] gdb/libpython.py does not work with gdb 7.2

2017-03-01 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Victor, the gdb commit that you mentioned introduced gdb.GdbError which is different from gdb.error. [1] The correct commit is 621c83642d17cf523c20f55f2ed945a7ec95ea6a. [2] [1] https://sourceware.org/gdb/current/onlinedocs/gdb/Exception-Handling.html

[issue29680] gdb/libpython.py does not work with gdb 7.2

2017-02-28 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <alexander.belopol...@gmail.com>: -- components: +Demos and Tools stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <http://bugs.pyt

[issue29680] gdb/libpython.py does not work with gdb 7.2

2017-02-28 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <alexander.belopol...@gmail.com>: -- pull_requests: +308, 309 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue29680] gdb/libpython.py does not work with gdb 7.2

2017-02-28 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <alexander.belopol...@gmail.com>: -- pull_requests: +308 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue29680] gdb/libpython.py does not work with gdb 7.2

2017-02-28 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <alexander.belopol...@gmail.com>: -- nosy: +haypo ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue29680] gdb/libpython.py does not work with gdb 7.2

2017-02-28 Thread Alexander Belopolsky
New submission from Alexander Belopolsky: Printing the backtrace in gdb results in Python errors: (gdb) bt ... #6 0x77ba9745 in _PyEval_EvalCodeWithName (_co=, globals=Traceback (most recent call last): File "/home/a/.virtualenvs/3.6g/bin/python3.6-gdb.py", line 1358, in

[issue29673] Some gdb macros are broken in 3.6

2017-02-27 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I tried to simply replace _PyUnicode_AsString with PyUnicode_AsUTF8, but it looks like code structure has changed and the pyframe and pystack macros don't work anymore. -- ___ Python tracker <

[issue29673] Some gdb macros are broken in 3.6

2017-02-27 Thread Alexander Belopolsky
New submission from Alexander Belopolsky: Some gdb macros defined in Misc/gdbinit got broken when _PyUnicode_AsString was renamed to PyUnicode_AsUTF8. (gdb) pystack No symbol "_PyUnicode_AsString" in current context. -- messages: 288684 nosy: belopolsky priority: norma

[issue29547] Add c code coverage to codecov

2017-02-13 Thread Alexander Belopolsky
New submission from Alexander Belopolsky: I had it done in my fork of cpython-mirror: https://github.com/abalkin/cpython/tree/ci -- assignee: belopolsky components: Tests messages: 287710 nosy: belopolsky priority: normal severity: normal status: open title: Add c code coverage

[issue29346] datetime.utcfromtimestamp() returns strange result for very large values

2017-01-22 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: This looks like a duplicate of issue #29100 ("datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6"). -- keywords: +3.6regression nosy: +haypo ___ Python tr

[issue28130] Document that time.tzset updates time module globals

2017-01-12 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <alexander.belopol...@gmail.com>: -- status: closed -> open ___ Python tracker <rep...@bugs.python.org> <http://bugs.pyt

[issue28130] Document that time.tzset updates time module globals

2017-01-12 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Committed in ec3b08b361c0. Thanks, Greg. Leaving open until 2.7 docs are fixed as well. -- resolution: -> fixed stage: -> resolved versions: +Python 2.7 -Python 3.6 ___ Python tracke

[issue29159] Regression in bytes constructor

2017-01-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On the other hand, the documentation for the bytearray constructor [1] lists integer argument first. [1]: https://docs.python.org/3/library/functions.html#bytearray -- ___ Python tracker <

[issue29159] Regression in bytes constructor

2017-01-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: @inada.naoki Sorry, I still don't understand the role of OverflowError. With respect to my earlier suggestion that buffer protocol should have priority over __index__, note that the documentation implies the same order: >>> help(bytes) cl

[issue29159] Regression in bytes constructor

2017-01-04 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Inada, Can you explain what your patch does? I don't understand why you single out the OverflowError. When is __index__ expected to raise it? >>> (2**300).

[issue29159] Regression in bytes constructor

2017-01-04 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Also relevant: * #20895 - Add bytes.empty_buffer and deprecate bytes(17) for the same purpose * PEP 467 - Minor API improvements for binary sequences -- ___ Python tracker <rep...@bugs.python.org>

[issue29159] Regression in bytes constructor

2017-01-04 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <alexander.belopol...@gmail.com>: -- nosy: +ncoghlan ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue29159] Regression in bytes constructor

2017-01-04 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I don't think we should put too much effort into preserving numpy behavior. Consider this python 3.5 session: >>> import numpy >>> a = numpy.array([1]) >>> bytes(a) __main__:1: VisibleDeprecationWarning: converting an array

[issue29159] Regression in bytes constructor

2017-01-04 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: My test code may seem contrived, but numpy arrays exhibit similar behavior: >>> a = numpy.array([2, 2]) >>> bytes(a) Traceback (most recent call last): File "", line 1, in TypeError: only integer arrays with one element

[issue29159] Regression in bytes constructor

2017-01-04 Thread Alexander Belopolsky
New submission from Alexander Belopolsky: Consider the following code: $ cat bug.py from array import array class C(array): def __new__(cls): return array.__new__(cls, 'B', b'abc') def __index__(self): raise TypeError x = C() print(bytes(x)) It works under python 3.5

[issue29097] datetime.fromtimestamp(t) when 0 <= t <= 86399 fails on Python 3.6

2016-12-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I think we should just clip the negative lower probe value to 0 on Windows before passing it to local(). Also, if we still care about platforms with 32-bit time_t, we should check for over/under flow *before* calling local

[issue28856] %b format for bytes does not support objects that follow the buffer protocol

2016-12-01 Thread Alexander Belopolsky
New submission from Alexander Belopolsky: Python 3.7.0a0 (default:be70d64bbf88, Dec 1 2016, 21:21:25) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>>

[issue28752] datetime object fails to restore from reduction

2016-11-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: It looks like Serhiy has already committed it. Thanks! -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue28752] datetime object fails to restore from reduction

2016-11-21 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <alexander.belopol...@gmail.com>: -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <http://bu

[issue28752] datetime object fails to restore from reduction

2016-11-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > If you can push this in the next hour or two ... I'll do it now. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.or

[issue28752] datetime object fails to restore from reduction

2016-11-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The patch LGTM. I'll commit it tonight unless Serhiy beats me to it. -- nosy: +alexandre.vassalotti, haypo, tim.peters ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue28752] datetime object fails to restore from reduction

2016-11-21 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <alexander.belopol...@gmail.com>: -- assignee: -> belopolsky stage: patch review -> commit review ___ Python tracker <rep...@bugs.python.org> <http://bugs.

[issue28752] datetime object fails to restore from reduction

2016-11-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > On Nov 20, 2016, at 12:34 PM, Serhiy Storchaka <rep...@bugs.python.org> wrote: > > The only way is to define both __reduce_ex__ and __reduce__ for time and > datewtime. OK. I'll review your patch and get it

[issue28752] datetime object fails to restore from reduction

2016-11-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > On Nov 20, 2016, at 11:10 AM, Serhiy Storchaka <rep...@bugs.python.org> wrote: > > Other way is to define __reduce_ex__ instead of __reduce__ in datetime.date. I would prefer this solution. -- ___

[issue28159] Deprecate isdst argument in email.utils.localtime

2016-11-18 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Keeping localtime as a convenience function in email.util is fine, but isdst argument should be eliminated at some point. There is a fundamental problem with disambiguating fold times with isdst: some folds do not involve the change in dst or happen

[issue28730] __reduce__ not being called in dervied extension class from datetime.datetime

2016-11-18 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > On Nov 18, 2016, at 8:49 AM, Serhiy Storchaka <rep...@bugs.python.org> wrote: > > But there are two drawbacks. It is not too late to make improvements. If you have specific proposals - please bring them up on t

[issue28730] __reduce__ not being called in dervied extension class from datetime.datetime

2016-11-18 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > On Nov 18, 2016, at 7:04 AM, Serhiy Storchaka <rep...@bugs.python.org> wrote: > > Yet one doubtful detail is that the fold bit is added to the hour bit in > datetime.time, but to the month field in datetime.datetime. The reason

[issue28635] Update What's New for 3.6

2016-11-10 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I spotted a small typo in the "PEP 495: Local Time Disambiguation" section: "The values of the fold attribute have the value 0 all instances ..." should be "The values of the fold attribute have the value 0 *for* all instan

[issue28641] Describe PEP 495 features in "What's New in Python 3.6" document

2016-11-08 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Paul (p-ganssle), based on your recent experience implementing PEP 495, what are the main points that we should cover in What's New? Also, any comments/criticism on the recent changes to the datetime module documentation are welcome

[issue28641] Describe PEP 495 features in "What's New in Python 3.6" document

2016-11-08 Thread Alexander Belopolsky
New submission from Alexander Belopolsky: See also #27595. -- assignee: belopolsky components: Documentation messages: 280320 nosy: belopolsky, p-ganssle, tim.peters priority: normal severity: normal stage: needs patch status: open title: Describe PEP 495 features in "What'

[issue28602] `tzinfo.fromutc()` fails when used for a fold-aware tzinfo implementation

2016-11-03 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > I can't think of a single actual downside to this change - all it does is > preserve the original behavior of `fromutc()`. You've got me on the fence here. If what you are saying is correct, it would make sense to make this change and bet

[issue28602] `tzinfo.fromutc()` fails when used for a fold-aware tzinfo implementation

2016-11-03 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Paul G at Github: """ To be clear, I'm just saying that fromutc() goes from returning something meaningful (the correct date and time, with no indication of what side of the fold it's on) to something useless (an incorrect date and ti

[issue28602] `tzinfo.fromutc()` fails when used for a fold-aware tzinfo implementation

2016-11-03 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I don't think timezones that satisfy the invariant expected by the default fromutc() is common enough that we need to provide special support for them. Note that in most cases it is the UTC to local conversion that is straightforward while Local

[issue28601] Ambiguous datetime comparisons should use == rather than 'is' for tzinfo comparison

2016-11-03 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: See Datetime-SIG thread <https://mail.python.org/pipermail/datetime-sig/2016-November/001010.html>. -- assignee: -> belopolsky nosy: +tim.peters stage: -> needs patch ___ Python

[issue1100942] Add datetime.time.strptime and datetime.date.strptime

2016-10-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Never mind the second question. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/iss

[issue1100942] Add datetime.time.strptime and datetime.date.strptime

2016-10-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Shouldn't "time part" underlined in my previous note be "date part" instead? Also, does non-zero mean non-empty? -- ___ Python tracker <rep...@bugs.python.org> <http:/

[issue28281] Remove year limits from calendar

2016-10-22 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The patch should include an update to documentation. 1. We should probably explain that python -mcalendar does not reproduce the output of UNIX cal. For example, on Mac OS (and various Linux variants): $ cal 9 1752 September 1752 Su Mo Tu We Th Fr

[issue2897] Deprecate structmember.h

2016-10-10 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <alexander.belopol...@gmail.com>: -- assignee: docs@python -> belopolsky stage: patch review -> commit review ___ Python tracker <rep...@bugs.python.org> <http://bugs

[issue28386] Improve documentation about tzinfo.dst(None)

2016-10-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: None is passed to tzinfo.dst() when it is called from time.dst() method. This is documented in the relevant section: <https://docs.python.org/3.5/library/datetime.html#datetime.time.dst>. I am not sure whether if it is worth repeating in the ab

[issue28383] __hash__ documentation recommends naive XOR to combine but this is suboptimal

2016-10-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: This makes sense. Note that this is the way hashes are implemented for the datetime objects: <https://hg.python.org/cpython/file/v3.6.0b1/Lib/datetime.py#l635>. -- nosy: +belopolsky ___ Python tracke

<    1   2   3   4   5   6   7   8   9   10   >