A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2005-September/336774.html below:

Bug in string.find; was: Re: Proposed PEP: New style indexing,wasRe: Bug in slice type

Bug in string.find; was: Re: Proposed PEP: New style indexing,wasRe: Bug in slice typeTerry Reedy tjreedy at udel.edu
Sat Sep 3 16:56:24 EDT 2005
"Ron Adam" <rrr at ronadam.com> wrote in message 
news:dHnSe.2098$4i6.1732 at tornado.tampabay.rr.com...
> (I was wondering why list's couldn't have len,min, and max attribute
> that are updated when ever the list is modified in place of using
> len,min, and max functions?

Python's list and, I believe, other builtin roster objects do have a 
C-level length attribute.  For mutables, it is updated.  __len__ is just a 
get of int value the and conversion to int object.  Min and max are defined 
and sensible for only a subset of lists, and when they are, are very seldom 
need repeated updates.

> Would the overhead be that much?)

For the fraction of times used, yes.

Terry J. Reedy




More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4