Title compiled generators fail typecheck for types.GeneratorType
Priority bug Status resolved
Superseder Nosy List aluedo, kayhayen
Assigned To kayhayen Keywords

Created on 2018-05-21.12:01:46 by aluedo, last changed by kayhayen.

msg2488 (view) Author: kayhayen Date: 2018-08-23.22:23:07
I created a new issue on Github for the libnuitka issue. It will solve your 
issue automatically. I am closing it, because the issue tracking is moved.

msg2424 (view) Author: kayhayen Date: 2018-07-09.06:32:51
I think the real solution for this is a "libnuitka", where code that patches 
around can be shared across extension modules and main program, and then there 
would only be one compiled function, generator, frame, etc. type.

This will have to wait until I take this on. Until then, compile all into one 
thing and it would work.

msg2414 (view) Author: aluedo Date: 2018-06-06.13:23:54

Yes, the main program is also compiled.
msg2409 (view) Author: kayhayen Date: 2018-06-01.09:42:52
Is the main program compiled too, or is it uncompiled?

msg2403 (view) Author: aluedo Date: 2018-05-21.13:15:17
Hello, does seem to include a test for the problematic check, which 
makes it even stranger.

The line that is causing issues is:

if not isinstance(gen, types.GeneratorType):

where gen is a generator returned from the function being decorated. 

The odd thing is that it seems to be working fine when i create a minimal 
example. It might be related to the fact that our application dynamically loads 
.so-files (compiled with nuitka) containing decorated methods.
msg2401 (view) Author: kayhayen Date: 2018-05-21.12:20:26
They do not inherit, but they ought to pass when "inspect" is used.

Can you check "tests/basics/" for what is missing:

And can you point me towards a minimal reproducer? It seems isinstance ought to 
work really.

msg2400 (view) Author: aluedo Date: 2018-05-21.12:01:46

The generators returned from code compiled by nuitka does not seem to inherit 
from types.GeneratorType, causing among things inlineCallbacks from twisted to 

Any help is appreciated.
Date User Action Args
2018-08-23 22:23:07kayhayensetstatus: deferred -> resolved
messages: + msg2488
2018-07-09 06:33:01kayhayensetstatus: chatting -> deferred
2018-07-09 06:32:51kayhayensetmessages: + msg2424
2018-06-06 13:23:54aluedosetmessages: + msg2414
2018-06-01 09:42:52kayhayensetmessages: + msg2409
2018-05-21 13:15:17aluedosetmessages: + msg2403
2018-05-21 12:20:26kayhayensetstatus: unread -> chatting
messages: + msg2401
2018-05-21 12:01:46aluedocreate