I find it very handy to check if an object is "empty" with the following construct:

```
l=[]
if l:
     do_stuff()

```

For a standard python list, the `if` will be executed only if the list is not empty.

My question is, how can I implement the same idea for my own objects?