Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'tree': 0.05; '(of': 0.07; 'class,': 0.07; 'method.': 0.07; 'item.': 0.09; 'occurrences': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'jan': 0.12; '7:45': 0.16; 'bytes)': 0.16; 'partly': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'sequence.': 0.16; 'such,': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'unicode': 0.24; 'least': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'needed.': 0.30; 'asked': 0.31; 'lists': 0.32; 'probably': 0.32; '(e.g.': 0.33; 'implemented': 0.33; 'case,': 0.35; 'definition': 0.35; 'objects': 0.35; 'really': 0.36; 'subject:List': 0.36; 'generic': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'received:173': 0.61; 'such': 0.63; 'received:fios.verizon.net': 0.84; 'strings)': 0.84; 'these.': 0.91; 'whereas': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Jan Reedy Subject: Re: List Count Date: Tue, 23 Apr 2013 15:01:33 -0400 References: <5175377f$0$29977$c3e8da3$5496439d@news.astraweb.com> <517545F7.5090209@nowhere.org> <5175c12f$0$29977$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-173-75-251-66.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 In-Reply-To: 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1366743690 news.xs4all.nl 2264 [2001:888:2000:d::a6]:40346 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:44207 On 4/23/2013 7:45 AM, Blind Anagram wrote: > I then wondered why count for lists has no limits Probably because no one has asked for such, as least partly because it is not really needed. In any case, .count(s) is a generic method. It is part of the definition of a Sequence. It can also be implemented for non-sequence collections, such as a Tree class, that allow multiple occurrences of an item. > whereas count for other objects (e.g. strings) has these. Strings (of unicode or bytes) are exceptional in multiple ways. -- Terry Jan Reedy