A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-November/083567.html below:

[Python-Dev] datetime and timedelta enhancement

[Python-Dev] datetime and timedelta enhancement [Python-Dev] datetime and timedelta enhancementVictor Stinner victor.stinner at haypocalc.com
Sat Nov 15 02:10:32 CET 2008
Le Saturday 15 November 2008 02:01:42 Victor Stinner, vous avez écrit :
> > 1- convert a datetime object to an epoch value (numbers of seconds since
> >    the 1st january 1970), eg. with a new totimestamp() method
> > 2- convert a timedelta to a specific unit (eg. seconds, days, weeks,
> > etc.)
>
> Another solution is proposed by Christian Heimes: "implement __int__
> and __float__ on timedelta objects (...)

The solution was implemented as patch in:
   http://bugs.python.org/issue1665292

The issue is closed and there was a problem with hash():
   timedelta(0, 1) == 1   
but 
   hash(timedelta(0, 1)) != hash(1)

-- 
Victor Stinner aka haypo
http://www.haypocalc.com/blog/
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4