"Ron Adam" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> (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



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to