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

Add ToEnum and Literal. #108

Closed Dreamsorcerer closed 1 year ago

Dreamsorcerer commented 4 years ago

This adds a ToEnum class.

I'm also suggesting deprecating the existing Atom and Enum, in favour of Literal (to match the implementation of the typing module). This will also allow Enum to be repurposed for enum.Enum in the future (if desired).

Dreamsorcerer commented 4 years ago

Python 2 is dead, can we remove those tests?

I'd like to add annotations to the rest of the project and get typing working in a future PR.

Deepwalker commented 4 years ago

About python2 deprecation – we can create new branch, like trafaret3.0, and move new development here. 2.0 version already supports py2k, so we should not abandon it for this version.

Dreamsorcerer commented 4 years ago

About python2 deprecation – we can create new branch, like trafaret3.0, and move new development here. 2.0 version already supports py2k, so we should not abandon it for this version.

Sounds good. Would you be happy to set the minimum version to 3.6 in the new branch? I'll be happy to start adding type annotations in a future PR then.

Arfey commented 4 years ago

don't forget to correct documentation, please 😀