This goes a bit further and allows you to define a generic type that is a patternProperties object, rather than just containing one (skipping the outer layer described there). Getting both the is-a relationship and this working was a bit of an ordeal and meant I didn't feel great just tossing it into helpers, the only thing I could get playing nice was to check the stringy-type of the class name (ugh!).
Also, it would be cool to get it to treat this thing as an actual generic type like the typing module gets (with __args__ and such) - I gave up on that for now in favor of a silly type-level constant, as it seemed like the kind of thing I could spend a long time on and get nowhere.
Fixes #10
This goes a bit further and allows you to define a generic type that is a patternProperties object, rather than just containing one (skipping the outer layer described there). Getting both the is-a relationship and this working was a bit of an ordeal and meant I didn't feel great just tossing it into helpers, the only thing I could get playing nice was to check the stringy-type of the class name (ugh!).
Also, it would be cool to get it to treat this thing as an actual generic type like the typing module gets (with
__args__
and such) - I gave up on that for now in favor of a silly type-level constant, as it seemed like the kind of thing I could spend a long time on and get nowhere.