thriftrw / thriftrw-python

A Thrift encoding library for Python
MIT License
36 stars 10 forks source link

Validate in struct and union constructors #42

Closed abhinav closed 9 years ago

abhinav commented 9 years ago

This makes validation happen in the constructors for struct and union instead of doing it during serialization. The intention is to fail as early as possible.

Also, numeric types are more liberals about what values count as valid. Most integral values can be casted into an i64, for example. We still don't do bounds checks, though.

Finally, BinaryTypeSpec was changed to be similar to TextTypeSpec. It now accepts unicode and automatically converts it into bytes.

Resolves #31. Resolves #33.

abhinav commented 9 years ago

@blampe @breerly @junchaowu

blampe commented 9 years ago

Looks great.