len()

Discussion in 'Python' started by Tobiah, Jan 27, 2009.

  1. Tobiah

    Tobiah Guest

    Just out of curiosity, why was len() made to
    be it's own function? I often find myself
    typing things like my_list.len before I
    catch myself.

    Thanks,

    Toby
     
    Tobiah, Jan 27, 2009
    #1
    1. Advertising

  2. Gabriel Genellina, Jan 27, 2009
    #2
    1. Advertising

  3. Tobiah

    Pat Guest

    Tobiah wrote:
    > Just out of curiosity, why was len() made to
    > be it's own function? I often find myself
    > typing things like my_list.len before I
    > catch myself.
    >
    > Thanks,
    >
    > Toby


    I'm surprised that no one responded to that question.

    I keep making that mistake all the time myself.
     
    Pat, Jan 31, 2009
    #3
  4. On Sat, 31 Jan 2009 13:27:02 -0500 Pat <> wrote:

    > Tobiah wrote:
    > > Just out of curiosity, why was len() made to
    > > be it's own function? I often find myself
    > > typing things like my_list.len before I
    > > catch myself.
    > >
    > > Thanks,
    > >
    > > Toby

    >
    > I'm surprised that no one responded to that question.
    >

    Huh? Gabriel Genellina replied about 46 minutes after it was posted.
    Might it be that your newsserver is a bit laggy?

    regards
    /W

    --
    My real email address is constructed by swapping the domain with the
    recipient (local part).
     
    Andreas Waldenburger, Jan 31, 2009
    #4
  5. Tobiah

    Pat Guest

    Andreas Waldenburger wrote:
    > On Sat, 31 Jan 2009 13:27:02 -0500 Pat <> wrote:
    >
    >> Tobiah wrote:
    >>> Just out of curiosity, why was len() made to
    >>> be it's own function? I often find myself
    >>> typing things like my_list.len before I
    >>> catch myself.
    >>>
    >>> Thanks,
    >>>
    >>> Toby

    >> I'm surprised that no one responded to that question.
    >>

    > Huh? Gabriel Genellina replied about 46 minutes after it was posted.
    > Might it be that your newsserver is a bit laggy?
    >
    > regards
    > /W
    >


    Might be laggy. Who knows.

    Why didn't you answer the len() question?
     
    Pat, Feb 4, 2009
    #5
  6. Pat wrote:

    > Why didn't you answer the len() question?


    It's a bit of a FAQ: len() cannot be a method of list objects because it
    works on any sequence or iterable.
     
    Marco Mariani, Feb 4, 2009
    #6
  7. En Wed, 04 Feb 2009 12:38:04 -0200, Pat <> escribió:
    > Andreas Waldenburger wrote:
    >> On Sat, 31 Jan 2009 13:27:02 -0500 Pat <> wrote:
    >>> Tobiah wrote:
    >>>> Just out of curiosity, why was len() made to
    >>>> be it's own function? I often find myself
    >>>> typing things like my_list.len before I
    >>>> catch myself.


    >>> I'm surprised that no one responded to that question.
    >>>

    >> Huh? Gabriel Genellina replied about 46 minutes after it was posted.
    >> Might it be that your newsserver is a bit laggy?

    >
    > Might be laggy. Who knows.
    > Why didn't you answer the len() question?


    Why should he? Why didn't you look for the answer yourself, after being
    told that it existed? Why do you expect *us* to repeat ourselves again and
    again? Don't be so lazy...

    You can read all these posts using the mailing list
    (), Usenet (comp.lang.python), Google Groups, and
    many other mirrors. See this same thread in 3 different ways:

    Google groups:
    http://groups.google.com/group/comp.lang.python/t/247ec641c289a326/

    Gmane:
    http://permalink.gmane.org/gmane.comp.python.general/608346

    Python.org:
    http://mail.python.org/pipermail/python-list/2009-January/526500.html

    and many others, like the "forum" look & feel provided by
    www.velocityreviews.com

    --
    Gabriel Genellina
     
    Gabriel Genellina, Feb 4, 2009
    #7
  8. Tobiah

    Terry Reedy Guest

    Pat wrote:
    > Andreas Waldenburger wrote:
    >> On Sat, 31 Jan 2009 13:27:02 -0500 Pat <> wrote:
    >>
    >>> Tobiah wrote:
    >>>> Just out of curiosity, why was len() made to
    >>>> be it's own function? I often find myself
    >>>> typing things like my_list.len before I
    >>>> catch myself.
    >>>>
    >>>> Thanks,
    >>>>
    >>>> Toby
    >>> I'm surprised that no one responded to that question.
    >>>

    >> Huh? Gabriel Genellina replied about 46 minutes after it was posted.
    >> Might it be that your newsserver is a bit laggy?
    >>
    >> regards
    >> /W
    >>

    >
    > Might be laggy. Who knows.
    >
    > Why didn't you answer the len() question?


    I didn't respond because it has been asked and answered before, so the
    answer can be found in the google archives or even maybe the FAQ.
     
    Terry Reedy, Feb 4, 2009
    #8
  9. Tobiah

    Pat Guest

    Gabriel Genellina wrote:
    > En Wed, 04 Feb 2009 12:38:04 -0200, Pat <> escribió:
    >> Andreas Waldenburger wrote:
    >>> On Sat, 31 Jan 2009 13:27:02 -0500 Pat <> wrote:
    >>>> Tobiah wrote:
    >>>>> Just out of curiosity, why was len() made to
    >>>>> be it's own function? I often find myself
    >>>>> typing things like my_list.len before I
    >>>>> catch myself.

    >
    >>>> I'm surprised that no one responded to that question.
    >>>>
    >>> Huh? Gabriel Genellina replied about 46 minutes after it was posted.
    >>> Might it be that your newsserver is a bit laggy?

    >>
    >> Might be laggy. Who knows.
    >> Why didn't you answer the len() question?

    >
    > Why should he? Why didn't you look for the answer yourself, after being
    > told that it existed? Why do you expect *us* to repeat ourselves again
    > and again? Don't be so lazy...
    >


    Why do *us* feel obligated to respond? Is there a gun pointed at your
    heads forcing to giving a bellicose responses?

    Who is this *us*? A secret society? An exclusive club?

    New rule: If you don't like a question or a post, simply ignore it. We
    don't enjoy your snarky repartee.
     
    Pat, Feb 8, 2009
    #9
  10. Tobiah

    Pat Guest

    Terry Reedy wrote:
    > Pat wrote:
    >> Andreas Waldenburger wrote:
    >>> On Sat, 31 Jan 2009 13:27:02 -0500 Pat <> wrote:
    >>>
    >>>> Tobiah wrote:
    >>>>> Just out of curiosity, why was len() made to
    >>>>> be it's own function? I often find myself
    >>>>> typing things like my_list.len before I
    >>>>> catch myself.
    >>>>>
    >>>>> Thanks,
    >>>>>
    >>>>> Toby
    >>>> I'm surprised that no one responded to that question.
    >>>>
    >>> Huh? Gabriel Genellina replied about 46 minutes after it was posted.
    >>> Might it be that your newsserver is a bit laggy?
    >>>
    >>> regards
    >>> /W
    >>>

    >>
    >> Might be laggy. Who knows.
    >>
    >> Why didn't you answer the len() question?

    >
    > I didn't respond because it has been asked and answered before, so the
    > answer can be found in the google archives or even maybe the FAQ.


    Yes, you did respond. Aren't you the one who wrote "Might be laggy"?

    If you didn't feel like answering the question, why did you add an
    utterly worthless post?
     
    Pat, Feb 8, 2009
    #10
  11. On Sun, 08 Feb 2009 07:54:13 -0500 Pat <> wrote:

    > Terry Reedy wrote:
    > > Pat wrote:
    > >> Andreas Waldenburger wrote:
    > >>> On Sat, 31 Jan 2009 13:27:02 -0500 Pat <> wrote:
    > >>>
    > >>>> Tobiah wrote:
    > >>>>> Just out of curiosity, why was len() made to
    > >>>>> be it's own function? I often find myself
    > >>>>> typing things like my_list.len before I
    > >>>>> catch myself.
    > >>>>>
    > >>>>> Thanks,
    > >>>>>
    > >>>>> Toby
    > >>>> I'm surprised that no one responded to that question.
    > >>>>
    > >>> Huh? Gabriel Genellina replied about 46 minutes after it was
    > >>> posted. Might it be that your newsserver is a bit laggy?
    > >>>
    > >>> regards
    > >>> /W
    > >>>
    > >>
    > >> Might be laggy. Who knows.
    > >>
    > >> Why didn't you answer the len() question?

    > >
    > > I didn't respond because it has been asked and answered before, so
    > > the answer can be found in the google archives or even maybe the
    > > FAQ.

    >
    > Yes, you did respond. Aren't you the one who wrote "Might be laggy"?
    >

    No, I am. Pretty clear from the "From" header. ;)


    > If you didn't feel like answering the question, why did you add an
    > utterly worthless post?
    >

    There, there. Let's not get too excited, OK? I made an observation that
    I felt might be beneficial to you (even if only marginally so). I did
    not mean it as an insult. I'm sorry if it seemed that way.

    /W

    --
    My real email address is constructed by swapping the domain with the
    recipient (local part).
     
    Andreas Waldenburger, Feb 8, 2009
    #11
  12. Tobiah

    Steve Holden Guest

    Andreas Waldenburger wrote:
    > On Sun, 08 Feb 2009 07:54:13 -0500 Pat <> wrote:
    >
    >> Terry Reedy wrote:
    >>> Pat wrote:
    >>>> Andreas Waldenburger wrote:
    >>>>> On Sat, 31 Jan 2009 13:27:02 -0500 Pat <> wrote:
    >>>>>
    >>>>>> Tobiah wrote:
    >>>>>>> Just out of curiosity, why was len() made to
    >>>>>>> be it's own function? I often find myself
    >>>>>>> typing things like my_list.len before I
    >>>>>>> catch myself.
    >>>>>>>
    >>>>>>> Thanks,
    >>>>>>>
    >>>>>>> Toby
    >>>>>> I'm surprised that no one responded to that question.
    >>>>>>
    >>>>> Huh? Gabriel Genellina replied about 46 minutes after it was
    >>>>> posted. Might it be that your newsserver is a bit laggy?
    >>>>>
    >>>>> regards
    >>>>> /W
    >>>>>
    >>>> Might be laggy. Who knows.
    >>>>
    >>>> Why didn't you answer the len() question?
    >>> I didn't respond because it has been asked and answered before, so
    >>> the answer can be found in the google archives or even maybe the
    >>> FAQ.

    >> Yes, you did respond. Aren't you the one who wrote "Might be laggy"?
    >>

    > No, I am. Pretty clear from the "From" header. ;)
    >
    >
    >> If you didn't feel like answering the question, why did you add an
    >> utterly worthless post?
    >>

    > There, there. Let's not get too excited, OK? I made an observation that
    > I felt might be beneficial to you (even if only marginally so). I did
    > not mean it as an insult. I'm sorry if it seemed that way.


    Right, well let's *all* calm down, and resolve not to bother making
    posts that don't contribute something positive. It's not like this is a
    low-bandwidth group, there's always plenty going on.

    regards
    Steve

    who is still hoping that one day Xah Lee will post and *nobody* will
    reply ...
    --
    Steve Holden +1 571 484 6266 +1 800 494 3119
    Holden Web LLC http://www.holdenweb.com/
     
    Steve Holden, Feb 8, 2009
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steven K

    Use of LEN()

    Steven K, Apr 5, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    872
    Lloyd Sheen
    Apr 5, 2004
  2. Massimiliano Alberti

    limits.h and int len

    Massimiliano Alberti, Feb 18, 2004, in forum: C Programming
    Replies:
    18
    Views:
    744
    Michael Wojcik
    Feb 24, 2004
  3. Jeff Wagner

    String length ... len(str)

    Jeff Wagner, Dec 4, 2003, in forum: Python
    Replies:
    7
    Views:
    416
    Dennis Lee Bieber
    Dec 4, 2003
  4. Tor Erik Soenvisen
    Replies:
    14
    Views:
    594
    Tim Roberts
    Nov 23, 2006
  5. maestro
    Replies:
    1
    Views:
    324
    Chris
    Aug 11, 2008
Loading...

Share This Page