seandstewart / typical

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

Fix Recursion Error for Derived Classes of `@typic.klass` #186

Closed seandstewart closed 2 years ago

seandstewart commented 2 years ago

Derived classes of a typic.klass object were improperly recognized as a simple Iterable.

This caused a recursion error when attempting to serialize these objects, since the __iter__ magic method relies upon the iterator factory, but the iterator factory simply called the __iter__ magic method.

Resolves #185

codecov[bot] commented 2 years ago

Codecov Report

Merging #186 (5d3fcba) into main (45bbaa0) will increase coverage by 0.00%. The diff coverage is 100.00%.

:exclamation: Current head 5d3fcba differs from pull request most recent head a38f49d. Consider uploading reports for the commit a38f49d to get more accurate results Impacted file tree graph

@@           Coverage Diff           @@
##             main     #186   +/-   ##
=======================================
  Coverage   94.98%   94.99%           
=======================================
  Files          37       37           
  Lines        4169     4172    +3     
  Branches      582      582           
=======================================
+ Hits         3960     3963    +3     
  Misses        129      129           
  Partials       80       80           
Flag Coverage Δ
unittests 94.87% <100.00%> (+<0.01%) :arrow_up:

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

Impacted Files Coverage Δ
typic/serde/translator.py 98.78% <ø> (ø)
typic/checks.py 97.36% <100.00%> (+0.03%) :arrow_up:
typic/serde/ser.py 97.59% <100.00%> (+0.01%) :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 45bbaa0...a38f49d. Read the comment docs.