I didn't notice until now, and it's a little late now that this is merged, but `sum` isn't a good variable name to use since it's a Python builtin.  Maybe 'total' might be better?

Also if the purpose is to count the number of intersecting bases a better way to do this might be:

```
len(set(compose._bases).intersection(set(bases))
```

though I haven't tested which is faster.