cattrs icon indicating copy to clipboard operation
cattrs copied to clipboard

cattrs.__all__ contains unimported "GenConverter"

Open sscherfke opened this issue 3 years ago • 6 comments

The __all__ list in cattrs/__init__.py contains GenConverter but it is not imported.

sscherfke avatar Jul 08 '22 15:07 sscherfke

Bleh must've gotten lost in a merge

Tinche avatar Jul 08 '22 15:07 Tinche

But cattrs.GenConverter will keep working in 22.2, won't it? You will not introduced a breaking change, won't you? 😇

sscherfke avatar Jul 08 '22 20:07 sscherfke

For 22.2 GenConverter now is an alias to Converter. The current Converter is renamed to BaseConverter.

aarnphm avatar Jul 08 '22 20:07 aarnphm

Yes, I’ve read this. I just wanted @Tinche to confirm that the mistake was not "not removing GenConverter from all" but "not setting GenConverter = Converter in cattrs.__init__" :)

sscherfke avatar Jul 08 '22 21:07 sscherfke

Seems like cattrs is relying on import side effect here. Since GenConverter is defined under .converter.py, this means when we have relative imports GenConverter should already be included in locals() of cattrs/__init__.py.

(printed from locals() of cattrs/__init__.py).

Screenshot 2022-07-08 at 14 44 07

aarnphm avatar Jul 08 '22 21:07 aarnphm

I'm confirming the GenConverter name should still be available. No need to cause even more breakage for no reason ;)

Tinche avatar Jul 08 '22 21:07 Tinche

Fixed on main!

Tinche avatar Sep 18 '22 18:09 Tinche