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


Groups > comp.lang.python > #72616

Re: Unicode and Python - how often do you index strings?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'from:addr:yahoo.co.uk': 0.04; 'subject:Python': 0.06; 'indexing': 0.07; 'string': 0.09; 'integers': 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; 'python': 0.11; 'language.': 0.14; 'centers,': 0.16; 'ideally,': 0.16; 'iterated': 0.16; 'iteration': 0.16; 'iteration,': 0.16; 'rarely': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:Unicode': 0.16; 'language': 0.16; 'wrote:': 0.18; 'discussion': 0.18; "python's": 0.19; 'examples': 0.20; 'header:User-Agent:1': 0.23; 'unicode': 0.24; '(or': 0.24; '---': 0.24; 'question': 0.24; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'characters': 0.30; 'code': 0.31; 'question:': 0.31; 'critical': 0.32; 'quite': 0.32; 'beginning': 0.33; 'implemented': 0.33; 'actual': 0.34; "can't": 0.35; 'operations': 0.35; 'but': 0.35; 'indexed': 0.36; 'thanks': 0.36; 'subject:?': 0.36; 'two': 0.37; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'either': 0.39; 'received:org': 0.40; 'how': 0.40; 'free': 0.61; 'length': 0.61; 'viruses': 0.61; 'protection': 0.63; 'our': 0.64; 'here': 0.66; 'close': 0.67; 'production': 0.68; 'antivirus': 0.68; 'end.': 0.84; 'received:2': 0.84; 'theories': 0.84; 'subject:you': 0.87; 'collective': 0.91
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: Unicode and Python - how often do you index strings?
Date Wed, 04 Jun 2014 09:22:13 +0100
References <CAPTjJmr4iHdaCy61w2rz-oL6FcarRzzTeEU44Fxn2Z=gS0fh-Q@mail.gmail.com>
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-205-183.as13285.net
User-Agent Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.5.0
In-Reply-To <CAPTjJmr4iHdaCy61w2rz-oL6FcarRzzTeEU44Fxn2Z=gS0fh-Q@mail.gmail.com>
X-Antivirus avast! (VPS 140603-1, 04/06/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 <python-list.python.org>
List-Unsubscribe <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.10689.1401870148.18130.python-list@python.org> (permalink)
Lines 35
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1401870148 news.xs4all.nl 2885 [2001:888:2000:d::a6]:40762
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:72616

Show key headers only | View raw


On 04/06/2014 01:39, Chris Angelico wrote:
> A current discussion regarding Python's Unicode support centres (or
> centers, depending on how close you are to the cent[er]{2} of the
> universe) around one critical question: Is string indexing common?
>
> Python strings can be indexed with integers to produce characters
> (strings of length 1). They can also be iterated over from beginning
> to end. Lots of operations can be built on either one of those two
> primitives; the question is, how much can NOT be implemented
> efficiently over iteration, and MUST use indexing? Theories are great,
> but solid use-cases are better - ideally, examples from actual
> production code (actual code optional).
>
> I know the collective experience of python-list can't fail to bring up
> a few solid examples here :)
>
> Thanks in advance, all!!
>
> ChrisA
>

Single characters quite often, iteration rarely if ever, slicing all the 
time, but does that last one count?

-- 
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

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


Thread

Re: Unicode and Python - how often do you index strings? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-06-04 09:22 +0100

csiph-web