mnba / shedskin

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

Getting a class in the .so, but not getting my generators #140

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Check out http://stromberg.dnsalias.org/svn/backshift/trunk using Subversion 
and cd into the new directory (the top level one)
2. make prep
3. mkdir subdir && cd subdir
4. ln -s ../rolling_checksum_py_mod.py rolling_checksum_ss_mod.py
5. shedskin -e -l rolling_checksum_ss_mod.py
6. python -c 'import rolling_checksum_ss_mod; 
print(dir(rolling_checksum_ss_mod))'

What is the expected output? What do you see instead?
Inside of rolling_checksum_ss_mod I was hoping to see one class and two 
generator functions.
Instead I see one class and 0 generator functions.

What version of the product are you using? On what operating system?
Shedskin 0.8 on Ubuntu 10.10.

Please provide any additional information below.
N/A

Thanks for the nice tool!  Shedskin is pretty cool, and I'm hoping to add it to:
http://stromberg.dnsalias.org/~strombrg/backshift/documentation/performance/inde
x.html

Original issue reported on code.google.com by strom...@gmail.com on 24 Jun 2011 at 6:04

GoogleCodeExporter commented 9 years ago
thanks for reporting!

please note that to compile it, a function has to be called (indirectly) from 
somewhere. otherwise, type inference can't work.. you can achieve some of this 
here by adding this to the bottom of the file:

if __name__ == '__main__':
    Rolling_checksum()
    min_max_chunker(open('test.py'))

if you do this, and recompile with shedskin you'll notice a few warnings about 
mixing different types here and there.. you will probably have to resolve all 
the warnings before getting C++ code that will compile further. please see the 
documentation for more details about what is and what is not supported.

unfortunately, no matter what you do, the generator functions still won't show 
up, because they are currently not exported..

Original comment by mark.duf...@gmail.com on 25 Jun 2011 at 4:18