cy99 / shedskin

Automatically exported from code.google.com/p/shedskin
0 stars 0 forks source link

Shedskin Accepts Function Objects In Containers, But Output tDoesn't Compile #36

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run the attached file "test.py" with python. It prints "0" or "100"
2. Generate a C++ file with Shedskin. "shedskin test.py"  It works
3. Try to compile the resulting file "make".  It doesn't compile.

What is the expected output? What do you see instead?
The included g++ throws out various type errors in builtin.hpp.

What version of the product are you using? On what operating system?
Shedskin 0.2 on Windows.

Please provide any additional information below.
The type inference seems to fail only when function objects are stored in
containers.  (Things works as expected when function objects are stored in
variables.)

Original issue reported on code.google.com by seun.osewa on 31 Jul 2009 at 12:08

Attachments:

GoogleCodeExporter commented 9 years ago
hi and thanks for reporting! 

the problem is that Shedskin uses C/C++ function types (function pointers) for 
type
declarations involving function references, which is not very flexible and 
currently
fails for contained objects. at some point, the function types should be 
replaced by
regular class types (inheriting from class pyobj in lib/builtin.hpp). 

anyway, this corresponds to a known limitation, as decribed in the tutorial 
(section
'python subset restrictions'). thanks anyway for reporting!

Original comment by mark.duf...@gmail.com on 4 Aug 2009 at 8:49