{"action":"opened","issue":{"url":"https://api.github.com/repos/cython/cython/issues/2770","repository_url":"https://api.github.com/repos/cython/cython","labels_url":"https://api.github.com/repos/cython/cython/issues/2770/labels{/name}","comments_url":"https://api.github.com/repos/cython/cython/issues/2770/comments","events_url":"https://api.github.com/repos/cython/cython/issues/2770/events","html_url":"https://github.com/cython/cython/issues/2770","id":394383112,"node_id":"MDU6SXNzdWUzOTQzODMxMTI=","number":2770,"title":"Function compilation decorator for pure mode","user":{"login":"h5rdly","id":24714022,"node_id":"MDQ6VXNlcjI0NzE0MDIy","avatar_url":"https://avatars2.githubusercontent.com/u/24714022?v=4","gravatar_id":"","url":"https://api.github.com/users/h5rdly","html_url":"https://github.com/h5rdly","followers_url":"https://api.github.com/users/h5rdly/followers","following_url":"https://api.github.com/users/h5rdly/following{/other_user}","gists_url":"https://api.github.com/users/h5rdly/gists{/gist_id}","starred_url":"https://api.github.com/users/h5rdly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h5rdly/subscriptions","organizations_url":"https://api.github.com/users/h5rdly/orgs","repos_url":"https://api.github.com/users/h5rdly/repos","events_url":"https://api.github.com/users/h5rdly/events{/privacy}","received_events_url":"https://api.github.com/users/h5rdly/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-27T12:33:04Z","updated_at":"2018-12-27T12:33:04Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nI was wondering whethter there is a way, or it is possible to add a way, to do something like:\r\n```python\r\nfrom cython import cythonize, other, cython, magics\r\n\r\n@cythonize  # Decorator of interest\r\n@other \r\n@cython\r\n@magics\r\ndef slow_function_at_work():\r\n      # omg so slow\r\n\r\n# slow function is fast at this point\r\n```\r\nI dug a bit inside some cython files, and saw there's a `pyx_to_dll` function, and a `cython_inline` function. \r\n\r\nIs it perhaps possible to - \r\n- Make `pyx_to_dll` read `StringIO` objects (probably not since I saw that path is formed into a command string)\r\n- Somehow work with `cython_inline(inspect.getsource(slow_function))`\r\n- Use some other method\r\n\r\nSo that one can @cythonize his functions in pure mode?\r\n\r\nI think this is the epitome of pure mode - the ability to decorate and move along, and let cython hook in the sped up code.\r\n\r\n\r\nThanks,\r\nEli"}}
{"actor":{"display_login":"h5rdly"}}