Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #35578

Re: How to get time.strptime()?

Path csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.004
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'subject:skip:t 10': 0.07; 'subject:How': 0.09; 'python': 0.09; 'imports': 0.09; 'warn': 0.09; 'thread': 0.11; 'dec': 0.15; '(meaning': 0.16; 'brutal': 0.16; 'bugs,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'happily': 0.16; 'messy': 0.16; 'name).': 0.16; 'sharp': 0.16; 'threads': 0.16; 'trivially': 0.16; 'wrote:': 0.17; 'resolved': 0.17; 'thu,': 0.17; '(or': 0.18; 'module': 0.19; 'sort': 0.21; 'import': 0.21; 'fairly': 0.21; 'supposed': 0.21; 'least': 0.25; 'header:In-Reply-To:1': 0.25; 'language.': 0.27; 'execution': 0.27; 'message-id:@mail.gmail.com': 0.27; "doesn't": 0.28; 'received:209.85.212': 0.28; 'starts': 0.29; "i'm": 0.29; 'could': 0.32; 'problem': 0.33; 'to:addr:python-list': 0.33; 'times.': 0.33; 'received:google.com': 0.34; 'doing': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; 'there': 0.35; 'explain': 0.36; 'why': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'sure': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'think': 0.40; 'solve': 0.62; 'perfect': 0.63; 'here': 0.65; 'risk': 0.66; 'fact,': 0.69; 'soon': 0.70; '100%': 0.76; 'subject:get': 0.81; 'magical': 0.93; 'imagine': 0.96
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ap3qnpoToU5Fl781TemxDX/+A4Ia3+bcTnJzVqlKVOk=; b=01qRbZPCt6H1wD2p0Ttaw7hrEHR57QHrQQB6qdEEWVLNadTnnheJZV3YmGBzCsjugL qcAYrjdiH33ck6fUOF9mKcjVPmBiA+L60yNN13GgMvcAVRSb0S6vpb9r17tJO6qAfX0K Cf9nEb7YZE3QwQ73nybREOKRr8NVKdxcEJCf+i5DIssLB2R46LGhwMUX9/CO/BBa8xJ5 yKCGI7gLglNg+0u++oQb/VIhXUbuSNaX6qR8lAeNsR4wZhqk8dwBd3xlyvh0/ufWHCnG 2TzV4ewlQH08Q90sj94tQQkcji+jppoKcOjiKGO7PonMXtrnD9E/ZliVl9YbinuEN+Do cckg==
MIME-Version 1.0
In-Reply-To <50DBD754.2030407@lightbird.net>
References <5692cd23-84e0-46d4-b48c-5c11a5377c0a@googlegroups.com> <mailman.1298.1356555987.29569.python-list@python.org> <0e36e143-5103-4b4b-aaa9-b7b1b768631b@googlegroups.com> <50DBD754.2030407@lightbird.net>
Date Thu, 27 Dec 2012 16:41:36 +1100
Subject Re: How to get time.strptime()?
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1322.1356586899.29569.python-list@python.org> (permalink)
Lines 31
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1356586899 news.xs4all.nl 6844 [2001:888:2000:d::a6]:47419
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:35578

Show key headers only | View raw


On Thu, Dec 27, 2012 at 4:06 PM, Mitya Sirenef <msirenef@lightbird.net> wrote:
> On 12/26/2012 10:09 PM, Gnarlodious wrote:
>>
>> This is problem that has unduly vexed me. When you start learning Python
>> they don't tell you about these sharp edges. Someone needs to explain. --
>> Gnarlie
>
>
> In fact, if there were no bugs, there would be no need to explain nor to
> pick the
> right time / place for explanations. Why doesn't Python warn that it's not
> 100% perfect? Are people just supposed to "know" this, magically?

People are supposed to know that Python is not 100% perfect because
there's no such thing as a 100% perfect language. The problem here is
that Python doesn't have any magical way to deal with messy imports in
multiple threads; the solution is to sort out the import before the
multiple threads get going (meaning that when each thread attempts the
import, it's resolved trivially by simply binding the existing module
to a new name).

Threads are fairly messy in the best of times. The only thing I could
imagine Python doing here would be a brutal global lock - as soon as
one thread starts any import, all other threads get locked out of
execution (or at least of other imports). And I'm not sure that'd
solve everything - plus it brings the risk that one thread can stall
the entire system with a failed or faulty import. If you can think of
of any way to improve this, I'm sure python-ideas will happily discuss
it.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How to get time.strptime()? Gnarlodious <gnarlodious@gmail.com> - 2012-12-26 08:33 -0800
  Re: How to get time.strptime()? Chris Rebert <clp2@rebertia.com> - 2012-12-26 09:34 -0800
  Re: How to get time.strptime()? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-12-26 17:43 +0000
    Re: How to get time.strptime()? Gnarlodious <gnarlodious@gmail.com> - 2012-12-26 11:18 -0800
  RE: How to get time.strptime()? Nick Cash <nick.cash@npcinternational.com> - 2012-12-26 21:06 +0000
    Re: How to get time.strptime()? Gnarlodious <gnarlodious@gmail.com> - 2012-12-26 19:09 -0800
      Re: How to get time.strptime()? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-12-27 04:40 +0000
      Re: How to get time.strptime()? Roy Smith <roy@panix.com> - 2012-12-26 23:53 -0500
      Re: How to get time.strptime()? Mitya Sirenef <msirenef@lightbird.net> - 2012-12-27 00:06 -0500
      Re: How to get time.strptime()? Chris Angelico <rosuav@gmail.com> - 2012-12-27 16:41 +1100
        Re: How to get time.strptime()? Gnarlodious <gnarlodious@gmail.com> - 2012-12-26 22:19 -0800
        Re: How to get time.strptime()? Gnarlodious <gnarlodious@gmail.com> - 2012-12-26 22:19 -0800
      Re: How to get time.strptime()? Ben Finney <ben+python@benfinney.id.au> - 2012-12-27 17:24 +1100
    Re: How to get time.strptime()? Gnarlodious <gnarlodious@gmail.com> - 2012-12-26 19:09 -0800
  Re: How to get time.strptime()? Gnarlodious <gnarlodious@gmail.com> - 2012-12-27 16:33 -0800
    Re: How to get time.strptime()? Ian Kelly <ian.g.kelly@gmail.com> - 2012-12-27 19:47 -0700
      Re: How to get time.strptime()? Gnarlodious <gnarlodious@gmail.com> - 2012-12-27 19:48 -0800
      Re: How to get time.strptime()? Gnarlodious <gnarlodious@gmail.com> - 2012-12-27 19:48 -0800

csiph-web