Issue401

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

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

Messages
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.

Yours,
Kay
msg2414 (view) Author: aluedo Date: 2018-06-06.13:23:54
Hello,

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?

Yours,
Kay
msg2403 (view) Author: aluedo Date: 2018-05-21.13:15:17
Hello,

Inspection.py 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/Inspection.py" for what is missing:

http://nuitka.net/gitweb/?
p=Nuitka.git;a=blob;f=tests/basics/Inspection.py;h=8f25d47cb10ce713fe3ab9860aca3
ac7f3990abf;hb=c6a7dfdf8f3fce071780ab976046f3bf672b97e8

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

Yours,
Kay
msg2400 (view) Author: aluedo Date: 2018-05-21.12:01:46
Hello,

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

Any help is appreciated.
History
Date User Action Args
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