[issue31167] timedelta produced by datetime.__sub__ does not take Daylight Savings Time into account

2017-08-09 Thread Joshua Li

New submission from Joshua Li:

See my SO answer and the corresponding question for detail: 
https://stackoverflow.com/a/45602760/5348393

Essentially, given two datetime.datetime instances t1 and t2, the following two 
syntactically different lines of code should be logically equivalent, but in 
fact differ by plus or minus one hour on Daylight Savings Time dates because 
`datetime.datetime.__sub__` does not appear to take DST into account.

`t1.timestamp()-t2.timestamp()`
`(t1-t2).total_seconds()`

I am not sure if this is by intentional design, or a behavioral bug.

--
components: Library (Lib)
messages: 300035
nosy: JoshuaRLi
priority: normal
severity: normal
status: open
title: timedelta produced by datetime.__sub__ does not take Daylight Savings 
Time into account
type: behavior
versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 
<http://bugs.python.org/issue31167>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32913] Improve regular expression HOWTO

2018-02-22 Thread Joshua Li

New submission from Joshua Li :

"Python HOWTOs are documents that cover a single, specific topic, and attempt 
to cover it fairly completely."

It would be quite helpful if the section "non-capturing-and-named-groups" in 
the regex HOWTO contained at least a mention and short usage example of the 
re.match.groupdict method, something I have found to be pythonic and useful, 
yet it does not appear frequently in the docs.

I will be submitting a PR for this.

--
assignee: docs@python
components: Documentation
messages: 312592
nosy: JoshuaRLi, docs@python
priority: normal
severity: normal
status: open
title: Improve regular expression HOWTO
type: enhancement

___
Python tracker 
<https://bugs.python.org/issue32913>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32913] Improve regular expression HOWTO

2018-02-22 Thread Joshua Li

Change by Joshua Li :


--
keywords: +patch
pull_requests: +5597
stage:  -> patch review

___
Python tracker 
<https://bugs.python.org/issue32913>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com