Sreenivas Reddy T <thatiparthysreeni...@gmail.com> writes:

> I would like to clear things here.I am assuming beginner as  a common
> denominator to this post.
>
> len() method is just a shortcut to __len__ magic method .So when you
> call len() on your own container type ,it does not traverse whole
> sequence ,it just calls __len__ method and returns value(assume
> self.size=0 in constructor) from this method.This value incremented or
> decremented in add and remove method on your container type.

This is an interesting point especially with Python3 returning something
other than lists for things like dict.keys. I'll dig into this a
little. 

Thanks.

[...]


-- 
~noufal
http://nibrahim.net.in

Honk if you are against noise pollution!
_______________________________________________
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers

Reply via email to