I often find myself wanting to do something like this:
for address in user.addresses:
if address.street == 123 Elm Street:
# there's an address from this street, so do something
break
else:
# do nothing; no addresses from that street
That could also be accomplished with
Some of my tables (in a web application using Pylons) will eventually
need to be partitioned to separate shards, but some tables won't. For
example, imagine that I'd like to partition a Users table across 3
different databases, while leaving others just on one master database.
I've read the