hpyproject / hpy

HPy: a better API for Python
https://hpyproject.org
MIT License
1.02k stars 52 forks source link

Add an example or test that uses HPy_mod_execute #443

Closed mattip closed 11 months ago

mattip commented 11 months ago

In porting hpy-0.9 to PyPy, I could not find an example of using the HPy_mod_execute slot. It is mentioned in the documentation

The Python interpreter will create the module for us from the HPyModuleDef specification. Additional initialization can be done in the HPy_mod_execute slot

but there is no example of using that slot.

fangerer commented 11 months ago

Not sure if we should do it in the quickstart example (since it is not really necessary in this example). But we can, ofc, link to one example. The incremental porting example shows it: https://docs.hpyproject.org/en/latest/porting-example/index.html#id1

steve-s commented 11 months ago

There are tests of this and little bit of documentation: https://github.com/hpyproject/hpy/blob/master/test/test_hpymodule.py

On Fri, Jul 21, 2023, 22:22 Florian Angerer @.***> wrote:

Not sure if we should do it in the quickstart example (since it is not really necessary in this example). But we can, ofc, link to one example. The incremental porting example shows it: https://docs.hpyproject.org/en/latest/porting-example/index.html#id1

— Reply to this email directly, view it on GitHub https://github.com/hpyproject/hpy/issues/443#issuecomment-1646200541, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALMKDKOQCFS2QBYRTZOEL3XRLQHVANCNFSM6AAAAAA2TIYGLU . You are receiving this because you are subscribed to this thread.Message ID: @.***>