Skip to content

Type casting exceptions; sparse declarative default bugfix

Latest
Compare
Choose a tag to compare
@TadLeonard TadLeonard released this 16 Sep 07:37
· 9 commits to master since this release
  • Errors during type casting (calls to .map_casted and .tuple_casted) will now be re-raised to the user as a TypeCastError that contains clearer information about which key/field was given an uncastable value
  • Fixed a bug (issue #5) where sparse declarative defaults resulted in KeyErrors. Basically, SparseEnumap must always have a complete dictionary of defaults. The goal of SparseEnumap is that you can get collections out of your data specs no matter what's missing. SparseEnumap.set_defaults works this way, so sparse usage of default() in the declarative style should work too.

Many thank to @jonemo for finding bugs, suggesting fixes, and suggesting the sparse declarative default feature.