The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Newsgroups: comp.lang.python
From: Steven D'Aprano <st...@REMOVE-THIS-cybersource.com.au>
Date: Fri, 18 Jan 2008 22:41:52 -0000
Local: Fri, Jan 18 2008 5:41 pm
Subject: Re: Efficient processing of large nuumeric data file
On Fri, 18 Jan 2008 12:06:56 -0600, Tim Chase wrote: It depends on what argument you pass to len(). > I don't know how efficient len() is (if it's internally linearly > counting the items in data, or if it's caching the length as data is > created/assigned/modifed) Lists, tuples and dicts (and maybe strings?) know how long they are, so Custom classes are free to define __len__ anyway they like. class MyList(list): Caching __len__ is left as an exercise to the reader... -- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||