Re: Timedelta constructor with string parameter

2014-09-23 Thread Felipe Menezes Machado
On Tue, Sep 23, 2014 at 6:39 PM, Skip Montanaro wrote: > > On Tue, Sep 23, 2014 at 4:11 AM, wrote: > >> I created some code recently to parse a string and create a timedelta >> from it. > > > Interesting. I notice that dateutil.parser.parse already understands you > notation: > > >>> x = dateuti

Re: Timedelta constructor with string parameter

2014-09-23 Thread Skip Montanaro
On Tue, Sep 23, 2014 at 4:11 AM, wrote: > I created some code recently to parse a string and create a timedelta from > it. Interesting. I notice that dateutil.parser.parse already understands you notation: >>> x = dateutil.parser.parse("5h32m15s") >>> x datetime.datetime(2014, 9, 23, 5, 32, 15

Timedelta constructor with string parameter

2014-09-23 Thread felipou
Hello everyone! I created some code recently to parse a string and create a timedelta from it. Right now it only accepts positive integers, and only hours, minutes and seconds, but I think it could be easily extended to support everything that timedelta accepts. time_delta_regex = re.compile(