halst/schema — pull request #45 by nerdvegas (2014-06-19 01:20:01+00:00)
Title: added nested prioritisation for dict validation

Consider the schema:

```
s = Schema({Optional('foo'): int, Optional(basestring): object})
```
Here we would like to have dict validation that ensures 'foo' is integer, but also allows any other extra, unvalidated items. It doesn't work though, because both schema keys have the same priority, and a 'foo' dict entry can be consumed by the Optional(basestring) schema.

This pull request contains a simple change so that prioritisation takes schema contents into account. For example, since a string instance would be used for validation before basestring (non-types before types), it follows that Optional(string instance) now takes precedence over Optional(basestring).