Support for Set in addition to List and Tuple?
Hi, thanks for the useful package!
Is there any technical reason behind Set support absence?
Or I'm a very first person who actually needs it?
If it's missed because no one needs it yet, and maintainers are not against it, I would like to provide pull request with such implementation. Documentation and tests included.
Hopefully, new minor release would be issued after this contribution.
Thoughts?
Regards, Artem.
I'm not against, of course. Did not include it, because generally, when you get something from internet in json, it is definitely does not include sets, instead it has list/array, and then you check that members of this set is uniq and then call set, like t.List() & uniq & set.
To check python structs, you can use t.Type(set).
Not sure what is you case, I'm open to new contributions.
I use trafaret as normalization library in the service layer of my application.
For example, here and there, now and then.
So, in my case it supposed to be used for:
- value is a set of elements of right type
- value could be normalized to set
- items of value could be normalized to specified type
If I understand correctly, it could be expressed already but would require a complicated expression instead of just Set.
In this case I vote for Set trafaret.