Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #12920
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <laurent.payot@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.016 |
| X-Spam-Evidence | '*H*': 0.97; '*S*': 0.00; 'anyway': 0.03; '(at': 0.03; 'worse': 0.07; 'message- id:@glegroupsg2000goo.googlegroups.com': 0.09; 'reply- to:addr:comp.lang.python': 0.09; 'to:addr:comp.lang.python': 0.09; 'tuple': 0.09; 'boolean': 0.16; 'bring,': 0.16; 'hypothetical': 0.16; 'subject:iterable': 0.16; 'cc:addr:python-list': 0.16; 'cc:no real name:2**0': 0.20; 'cc:2**0': 0.22; 'header:In-Reply- To:1': 0.22; 'somewhere': 0.23; "i'm": 0.27; 'fact': 0.27; 'asking': 0.29; 'cc:addr:python.org': 0.30; 'subject:?': 0.31; 'there': 0.33; 'header:User-Agent:1': 0.34; 'checking': 0.34; 'integer': 0.34; 'received:209.85.160': 0.35; 'totally': 0.35; 'certain': 0.35; 'issue': 0.36; 'using': 0.37; 'but': 0.37; 'something': 0.37; 'think': 0.38; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.39; 'why': 0.39; 'subject: (': 0.39; "it's": 0.40; 'received:209.85.160.184': 0.67; 'received:mail-gy0-f184.google.com': 0.67; 'subject:are': 0.70; 'header:Reply-To:1': 0.71; 'reply-to:no real name:2**0': 0.71; 'reply-to:addr:googlegroups.com': 0.74; 'subject:you': 0.81; 'no?': 0.84; 'subject:Best': 0.93 |
| Newsgroups | comp.lang.python |
| Date | Wed, 7 Sep 2011 16:22:36 -0700 (PDT) |
| In-Reply-To | <mailman.849.1315435715.27778.python-list@python.org> |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | glegroupsg2000goo.googlegroups.com; posting-host=82.239.111.183; posting-account=v7uz7AoAAADrY3ej1N8wVPiFcnr81fn4 |
| References | <264a83d7-aa43-4e36-b39e-3e67488279b6@glegroupsg2000goo.googlegroups.com> <mailman.849.1315435715.27778.python-list@python.org> |
| User-Agent | G2/1.0 |
| X-Google-Web-Client | true |
| MIME-Version | 1.0 |
| Subject | Re: Best way to check that you are at the beginning (the end) of an iterable? |
| From | Laurent <laurent.payot@gmail.com> |
| To | comp.lang.python@googlegroups.com |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Cc | python-list@python.org |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| Precedence | list |
| Reply-To | comp.lang.python@googlegroups.com |
| 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> |
| Message-ID | <mailman.851.1315437766.27778.python-list@python.org> (permalink) |
| Lines | 4 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1315437766 news.xs4all.nl 2485 [2001:888:2000:d::a6]:42473 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:12920 |
Show key headers only | View raw
I totally understand the performance issue that an hypothetical "istail" would bring, even if I think it would just be the programmer's responsibility not to use it when it's not certain that an end can be detected. But I don't see why *adding* something like "ishead" would be so bad (at worse by using a boolean somewhere as you mentioned). Anyway I was just asking if there is something better than enumerate. So the answer is no? The fact that I have to create a tuple with an incrementing integer for something as simple as checking that I'm at the head just sounds awfully unpythonic to me.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Best way to check that you are at the beginning (the end) of an iterable? Laurent <laurent.payot@gmail.com> - 2011-09-07 14:35 -0700
Re: Best way to check that you are at the beginning (the end) of an iterable? Cameron Simpson <cs@zip.com.au> - 2011-09-08 08:48 +1000
Re: Best way to check that you are at the beginning (the end) of an iterable? Laurent <laurent.payot@gmail.com> - 2011-09-07 16:22 -0700
Re: Best way to check that you are at the beginning (the end) of an iterable? Laurent <laurent.payot@gmail.com> - 2011-09-07 16:22 -0700
Re: Best way to check that you are at the beginning (the end) of an iterable? Cameron Simpson <cs@zip.com.au> - 2011-09-08 10:23 +1000
Re: Best way to check that you are at the beginning (the end) of an iterable? Laurent <laurent.payot@gmail.com> - 2011-09-07 17:53 -0700
Re: Best way to check that you are at the beginning (the end) of an iterable? Laurent <laurent.payot@gmail.com> - 2011-09-07 17:53 -0700
Re: Best way to check that you are at the beginning (the end) of an iterable? Chris Torek <nospam@torek.net> - 2011-09-08 14:21 +0000
Re: Best way to check that you are at the beginning (the end) of an iterable? Cameron Simpson <cs@zip.com.au> - 2011-09-09 08:39 +1000
Re: Best way to check that you are at the beginning (the end) of an iterable? Tim Chase <python.list@tim.thechases.com> - 2011-09-07 19:01 -0500
Re: Best way to check that you are at the beginning (the end) of an iterable? Laurent <laurent.payot@gmail.com> - 2011-09-07 18:08 -0700
Re: Best way to check that you are at the beginning (the end) of an iterable? Laurent <laurent.payot@gmail.com> - 2011-09-07 18:08 -0700
Re: Best way to check that you are at the beginning (the end) of an iterable? Terry Reedy <tjreedy@udel.edu> - 2011-09-07 21:06 -0400
Re: Best way to check that you are at the beginning (the end) of an iterable? Peter Otten <__peter__@web.de> - 2011-09-09 13:04 +0200
Re: Best way to check that you are at the beginning (the end) of an iterable? Chris Angelico <rosuav@gmail.com> - 2011-09-09 21:30 +1000
Re: Best way to check that you are at the beginning (the end) of an iterable? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-09-08 10:24 +1000
Re: Best way to check that you are at the beginning (the end) of an iterable? Terry Reedy <tjreedy@udel.edu> - 2011-09-07 21:08 -0400
Re: Best way to check that you are at the beginning (the end) of an iterable? Laurent <laurent.payot@gmail.com> - 2011-09-07 18:05 -0700
Re: Best way to check that you are at the beginning (the end) of an iterable? Miki Tebeka <miki.tebeka@gmail.com> - 2011-09-07 17:24 -0700
Re: Best way to check that you are at the beginning (the end) of an iterable? Laurent <laurent.payot@gmail.com> - 2011-09-07 18:06 -0700
Re: Best way to check that you are at the beginning (the end) of an iterable? Chris Rebert <clp2@rebertia.com> - 2011-09-07 19:27 -0700
csiph-web