STINNER Victor <vstin...@python.org> added the comment:

Another minor issue: "assert(PyScanner_Check(self));" and 
"assert(PyEncoder_Check(self));" were removed by commit 
33f15a16d40cb8010a8c758952cbf88d7912ee2d when _json module got a module state.

scanner_traverse(), scanner_clear(), encoder_traverse() and encoder_clear() 
cannot get the module state of a module using PEP 489 multiphase initialization.

Similar issue in scanner_call() and encoder_call().

I'm not sure that the PEP 573 provide a solution for this exact issue, since 
the intent of the assertion is to check the type of the argument. The PEP 573 
gives access to the module state through types. But here we are not sure that 
the object type is the expected type... :-)

Again, it's a minor issue, it can be ignored. That's why I accepted to merge 
the commit. Technically, I don't see how we could get the wrong type in 
practice.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40137>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to