Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

len()

0 views
Skip to first unread message

Tobiah

unread,
Jan 27, 2009, 5:30:29 PM1/27/09
to
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

Gabriel Genellina

unread,
Jan 27, 2009, 6:16:02 PM1/27/09
to pytho...@python.org

Pat

unread,
Jan 31, 2009, 1:27:02 PM1/31/09
to

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

I keep making that mistake all the time myself.

Andreas Waldenburger

unread,
Jan 31, 2009, 2:16:48 PM1/31/09
to
On Sat, 31 Jan 2009 13:27:02 -0500 Pat <P...@junk.net> 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).

Pat

unread,
Feb 4, 2009, 9:38:04 AM2/4/09
to
Andreas Waldenburger wrote:
> On Sat, 31 Jan 2009 13:27:02 -0500 Pat <P...@junk.net> 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?

Marco Mariani

unread,
Feb 4, 2009, 10:02:08 AM2/4/09
to
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.

Tino Wildenhain

unread,
Feb 4, 2009, 11:19:13 AM2/4/09
to Marco Mariani, pytho...@python.org

Thats only half of the truth :-)

len() can use some internal optimizations on certain objects
where sequences indeed have a len() method called __len__()

Regards
Tino

Gabriel Genellina

unread,
Feb 4, 2009, 1:50:17 PM2/4/09
to pytho...@python.org
En Wed, 04 Feb 2009 12:38:04 -0200, Pat <P...@junk.net> escribió:
> Andreas Waldenburger wrote:
>> On Sat, 31 Jan 2009 13:27:02 -0500 Pat <P...@junk.net> 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
(pytho...@python.org), 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

Terry Reedy

unread,
Feb 4, 2009, 2:11:20 PM2/4/09
to pytho...@python.org

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.

Pat

unread,
Feb 8, 2009, 7:51:32 AM2/8/09
to
Gabriel Genellina wrote:
> En Wed, 04 Feb 2009 12:38:04 -0200, Pat <P...@junk.net> escribió:
>> Andreas Waldenburger wrote:
>>> On Sat, 31 Jan 2009 13:27:02 -0500 Pat <P...@junk.net> 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

unread,
Feb 8, 2009, 7:54:13 AM2/8/09
to

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?

Andreas Waldenburger

unread,
Feb 8, 2009, 11:44:14 AM2/8/09
to

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.

Steve Holden

unread,
Feb 8, 2009, 12:00:52 PM2/8/09
to pytho...@python.org

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/

0 new messages