seandstewart / typical

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

Regression with Deserializing Generators #115

Closed seandstewart closed 4 years ago

seandstewart commented 4 years ago

Description

typic.iterate doesn't recognize generators as iterable, so iterates over its public attributes instead.

What I Did

>>> import typic
>>> typic.transmute(list, (x for x in range(10)))
[<code object <genexpr> at 0x105180660, file "<input>", line 1>, <frame at 0x7f804bef20f0, file '<input>', line 1, code <genexpr>>, False, None]