Deepwalker / trafaret

Ultimate transformation library that supports validation, contexts and aiohttp.
http://trafaret.readthedocs.org/en/latest/
BSD 2-Clause "Simplified" License
177 stars 31 forks source link

Extension with zero sign for StrBool #46

Closed sonerayberk closed 5 years ago

sonerayberk commented 5 years ago

As with N or Y values some API's returns Z as False as well. Also in the original StrBool - 0 value exists, so here is the suggestion to extend StrBool Trafaret with z value.

asvetlov commented 5 years ago

I suggest using a custom project-specific trafaret for the case. Otherwise, we will end up with listing half of alphabet. z for false sounds very confusing to me. I wonder if there is an API that assumes z for true?

sonerayberk commented 5 years ago

@asvetlov Thanks for the feedback. I thought it would be nice to have a built in way to convert Z (I meant Zero) to False, but your argument with listing alphabet sounds reasonable too.