Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.015 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'from:addr:yahoo.co.uk': 0.04; 'classes.': 0.09; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'wrapper': 0.09; 'python': 0.11; 'wrote': 0.14; 'language.': 0.14; 'computes': 0.16; 'pity': 0.16; 'pythonista,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'roy': 0.16; 'str()': 0.16; 'language': 0.16; 'wrote:': 0.18; 'value.': 0.19; 'print': 0.22; 'header:User-Agent:1': 0.23; '---': 0.24; 'second': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; "i'm": 0.30; 'code': 0.31; 'supposed': 0.32; 'ago': 0.33; 'moment': 0.34; '"the': 0.34; 'subject: (': 0.35; 'in.': 0.36; 'like,': 0.36; 'module.': 0.36; 'set.': 0.36; 'useful': 0.36; 'being': 0.38; 'represent': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'previous': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'either': 0.39; 'received:org': 0.40; 'how': 0.40; 'free': 0.61; 'viruses': 0.61; 'first': 0.61; 'protection': 0.63; 'our': 0.64; 'hours': 0.66; 'antivirus': 0.68; 'periodically': 0.68; 'roles': 0.68; 'smith': 0.68; 'default': 0.69; 'day': 0.76; 'ethan': 0.84; 'furman': 0.84; 'received:2': 0.84; 'imagine': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: YADTR (Yet Another DateTime Rant) Date: Wed, 26 Mar 2014 09:27:51 +0000 References: <53322B22.6040100@stoneleaf.us> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-2-98-198-214.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 In-Reply-To: <53322B22.6040100@stoneleaf.us> X-Antivirus: avast! (VPS 140325-1, 25/03/2014), Outbound message X-Antivirus-Status: Clean X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 33 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1395826085 news.xs4all.nl 2867 [2001:888:2000:d::a6]:40334 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:69111 On 26/03/2014 01:19, Ethan Furman wrote: > On 03/25/2014 05:58 PM, Roy Smith wrote: >> One of my roles on this newsgroup is to periodically whine about >> stupidities in the Python datetime module. This is one of those times. >> >> I have some code which computes how long ago the sun set. Being a nice >> pythonista, I'm using a timedelta to represent this value. It would be >> difficult to imagine a less useful default way to print a timedelta: >> >> previous sunset: -1 day, 22:25:26.295993 >> >> The idea of str() is that it's supposed to return a human-friendly >> representation of a value. Humans do not say things like, "The sun set >> 1 day ago plus 22 hours and 25 minutes". > > I'm not sure whether to admire you for your stick-to-it-iveness, or pity > you for the plight you are in. Either the first or second time I hit a > datetime WTF moment I wrote my own wrapper classes. > dateutils for me. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence --- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com