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: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'attribute': 0.07; 'indices': 0.07; 'subject:How': 0.09; 'function,': 0.09; 'integers': 0.09; 'cc:addr:python-list': 0.10; 'sat,': 0.15; '23,': 0.16; 'function?': 0.16; 'nameerror:': 0.16; 'subject:array': 0.16; 'subject:object': 0.16; 'typeerror:': 0.16; 'wrote:': 0.17; "skip:' 30": 0.18; 'thanks.': 0.20; '>>>': 0.22; 'string': 0.22; 'trying': 0.22; 'header:In-Reply-To:1': 0.23; 'import': 0.24; 'defined': 0.24; 'tried': 0.26; 'message- id:@mail.gmail.com': 0.27; 'cc:2**0': 0.27; 'array': 0.27; 'received:209.85.214.174': 0.27; 'cc:addr:python.org': 0.29; '"",': 0.29; 'this.': 0.29; 'url:mailman': 0.29; 'hi,': 0.30; '(most': 0.30; "i'm": 0.30; 'url:python': 0.31; 'lines': 0.32; "skip:' 10": 0.32; 'appreciated.': 0.32; 'url:listinfo': 0.33; 'subject:?': 0.33; 'skip:> 10': 0.33; 'file': 0.34; 'received:google.com': 0.34; 'along': 0.35; 'received:209.85': 0.35; 'url:org': 0.35; 'something': 0.36; 'possible': 0.37; 'subject:: ': 0.37; 'received:209': 0.37; 'pm,': 0.38; 'header:Received:5': 0.39; 'more': 0.63; 'subject:get': 0.81; 'url:cpython': 0.84; 'to:addr:yahoo.com': 0.85; 'do:': 0.91; 'last):': 0.91; 'received:mail-ob0-f174.google.com': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=X2ZKFFGKKJb7cKJwWYzMlbfQvnvfdxdO9GNFt1LBLIA=; b=eJRn3+xeueGkBy1Kplc4iG0QBfn0gawdoXGX3Z3A3zuaj1zSHLgRT1LJOeblHzMzUU +kLAxLsT3KxsV+W9PbjX5fF8FJuF0ms5pjplqyO8yyWfqCYX8+ohix+HOYU2CUiEIjGa L2HS7+sTPJt/NdwEqRSd6pMiqW+rskl8rB2r4ZsO+3mIWSO7kez19z4NypayCPjC9CcM ROLQikQTN42pqDtWu96egXZONuLlUqz7n1mNGcnCwN5gM4Gt6rOSNl5AS6Vp/TnGuCcV vLPneH8/kcv4wKieLiCyHMfR595MEH+xk61md66ZS5ZZhdxqVtaAgrZ60KGYg382uN7h XI+Q== MIME-Version: 1.0 In-Reply-To: <1340504596.65359.YahooMailClassic@web164606.mail.gq1.yahoo.com> References: <1340504596.65359.YahooMailClassic@web164606.mail.gq1.yahoo.com> From: Ignacio Mondino Date: Sun, 24 Jun 2012 00:34:09 -0300 Subject: Re: How can i call array_length to get the length of array object? To: gmspro Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: python-list X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 68 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1340508871 news.xs4all.nl 6921 [2001:888:2000:d::a6]:52491 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:24379 On Sat, Jun 23, 2012 at 11:23 PM, gmspro wrote: > > Hi, > > I tried this, > >>> import array > >>> from array import array > >>> arr=3Darray('i',[5,7,8]) > >>> arr.sg_length > Traceback (most recent call last): > =C2=A0 File "", line 1, in > AttributeError: 'array.array' object has no attribute 'sg_length' > >>> arr=3Darray('i'[5,8,7]) > Traceback (most recent call last): > =C2=A0 File "", line 1, in > TypeError: string indices must be integers > >>> arr=3Darray('i',[5,8,7]) > >>> arr.length > Traceback (most recent call last): > =C2=A0 File "", line 1, in > AttributeError: 'array.array' object has no attribute 'length' > >>> arr.length() > Traceback (most recent call last): > =C2=A0 File "", line 1, in > AttributeError: 'array.array' object has no attribute 'length' > >>> length(arr) > Traceback (most recent call last): > =C2=A0 File "", line 1, in > NameError: name 'length' is not defined > >>> array_length(arr) > Traceback (most recent call last): > =C2=A0 File "", line 1, in > NameError: name 'array_length' is not defined > >>> arr.array_length() > Traceback (most recent call last): > =C2=A0 File "", line 1, in > AttributeError: 'array.array' object has no attribute 'array_length' > >>> arr.array_length > Traceback (most recent call last): > =C2=A0 File "", line 1, in > AttributeError: 'array.array' object has no attribute 'array_length' > > I'm trying to call this function, http://hg.python.org/cpython/file/3b723= 0997425/Modules/arraymodule.c#l657 > > Is that possible to call that function? > > I know it's possible to do: > >>>len(arr) > >>>arr.itemsize > > Any asnwer will be highly appreciated. > > Thanks. > > -- > http://mail.python.org/mailman/listinfo/python-list Hi, something along the lines >>> s =3D 'supercalifragilisticexpialidocious' >>> len(s) 34 check http://docs.python.org/ for more on this. Ignacio