<p>example:</p>

<pre><code>a_list = [1, 2, 3]
a_list.len() # doesn't work
len(a_list) # works
</code></pre>

<p>Python being (very) object oriented, I don't understand why the 'len' function isn't inherited by the object. 
Plus I keep trying the wrong solution since it appears as the logical one to me</p>

Maybe you're looking for
```
__len__
```
.  If that method exists, then len(a) calls it:
```
```
>>> class Spam:
...   def __len__(self): return 3
... 
>>> s = Spam()
>>> len(s)
3
```
```