tommikaikkonen / prettyprinter

Syntax-highlighting, declarative and composable pretty printer for Python 3.5+
https://prettyprinter.readthedocs.io
MIT License
336 stars 20 forks source link

Fixes for Python 3.6 dataclasses #18

Closed dangirsh closed 6 years ago

dangirsh commented 6 years ago

Rename _MISSING to MISSING dataclasses.fields() returns a tuple, but the code was expecting something with .values()

Tested on Python 3.6. Unsure how this ever worked. Maybe related to dataclasses changes from 3.5 to 3.6?

tommikaikkonen commented 6 years ago

Thanks for the patch!

I implemented the pretty printer for dataclasses before _MISSING became a part of the public API--I opened the issue for it :) https://github.com/ericvsmith/dataclasses/issues/114

Not sure about the .values() change, my guess is they changed the return value of fields, because as far as I recall it worked correctly when I implemented it.

tommikaikkonen commented 6 years ago

Released this patch in version 0.13.2.