Equality semantics for has_code

This helps a lot with writing tests. Predicates are great, super flexible, but it'd be nice if we can inspect them. Fortunately, has_code is pure, so memoization can really help us out here; we're leveraging functions' default identity-means-equality behavior.

The docs and tests are written to only specify equality, so if one day someone decides to write a fancier version using a class (e.g. for a better repr), they won't need to change that test.

I'm quite happy with the commit messages.