seandstewart / typical

Typical: Fast, simple, & correct data-validation using Python 3 typing.
https://python-typical.org
MIT License
182 stars 9 forks source link

Ignore member descriptors Tagged Unions #143

Closed seandstewart closed 3 years ago

seandstewart commented 3 years ago

Types with slots have member_descriptor placeholders on the type, which should not be considered valid tags for a union, as they have no actual value.

Additionally, this PR drops our reliance on guard_recursion in the slotted decorator, which will improve performance and no longer interfere with other systems which rely on settrace().

codecov[bot] commented 3 years ago

Codecov Report

Merging #143 (9079926) into main (4d24684) will increase coverage by 0.05%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #143      +/-   ##
==========================================
+ Coverage   93.30%   93.35%   +0.05%     
==========================================
  Files          37       37              
  Lines        4272     4276       +4     
==========================================
+ Hits         3986     3992       +6     
+ Misses        286      284       -2     
Flag Coverage Δ
3.8 93.35% <100.00%> (+0.05%) :arrow_up:
unittests 93.35% <100.00%> (+0.05%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
typic/klass.py 100.00% <100.00%> (+4.87%) :arrow_up:
typic/util.py 89.90% <100.00%> (+0.20%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 4d24684...9079926. Read the comment docs.