{"action":"created","issue":{"url":"https://api.github.com/repos/cython/cython/issues/2758","repository_url":"https://api.github.com/repos/cython/cython","labels_url":"https://api.github.com/repos/cython/cython/issues/2758/labels{/name}","comments_url":"https://api.github.com/repos/cython/cython/issues/2758/comments","events_url":"https://api.github.com/repos/cython/cython/issues/2758/events","html_url":"https://github.com/cython/cython/issues/2758","id":391099040,"node_id":"MDU6SXNzdWUzOTEwOTkwNDA=","number":2758,"title":"Pickling nested Cython function results in PicklingError","user":{"login":"deatinor","id":11456434,"node_id":"MDQ6VXNlcjExNDU2NDM0","avatar_url":"https://avatars0.githubusercontent.com/u/11456434?v=4","gravatar_id":"","url":"https://api.github.com/users/deatinor","html_url":"https://github.com/deatinor","followers_url":"https://api.github.com/users/deatinor/followers","following_url":"https://api.github.com/users/deatinor/following{/other_user}","gists_url":"https://api.github.com/users/deatinor/gists{/gist_id}","starred_url":"https://api.github.com/users/deatinor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deatinor/subscriptions","organizations_url":"https://api.github.com/users/deatinor/orgs","repos_url":"https://api.github.com/users/deatinor/repos","events_url":"https://api.github.com/users/deatinor/events{/privacy}","received_events_url":"https://api.github.com/users/deatinor/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-14T12:51:02Z","updated_at":"2018-12-14T13:58:16Z","closed_at":"2018-12-14T13:58:16Z","author_association":"NONE","body":"I have the following code:\r\n\r\n    def decorator(func):\r\n\r\n        @functools.wraps(func)\r\n        def other_func():\r\n            print('other func')\r\n\r\n        return other_func\r\n \r\n    @decorator\r\n    def func():\r\n        pass\r\n\r\nIf I try to pickle `func` everything works. However if I compile the module as a Cython extension it fails. Here is the error:\r\n\r\n    >>>> pickle.dumps(module.func)\r\n\r\n    PicklingError: Can't pickle <cyfunction decorator.<locals>.other_func at 0x102a45a58>: attribute lookup other_func on module failed\r\n\r\nThe same happens if I use `dill` instead of `pickle`.\r\n\r\nIs this an expected behaviour or is it a bug?"},"comment":{"url":"https://api.github.com/repos/cython/cython/issues/comments/447333058","html_url":"https://github.com/cython/cython/issues/2758#issuecomment-447333058","issue_url":"https://api.github.com/repos/cython/cython/issues/2758","id":447333058,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NzMzMzA1OA==","user":{"login":"scoder","id":491659,"node_id":"MDQ6VXNlcjQ5MTY1OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/491659?v=4","gravatar_id":"","url":"https://api.github.com/users/scoder","html_url":"https://github.com/scoder","followers_url":"https://api.github.com/users/scoder/followers","following_url":"https://api.github.com/users/scoder/following{/other_user}","gists_url":"https://api.github.com/users/scoder/gists{/gist_id}","starred_url":"https://api.github.com/users/scoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scoder/subscriptions","organizations_url":"https://api.github.com/users/scoder/orgs","repos_url":"https://api.github.com/users/scoder/repos","events_url":"https://api.github.com/users/scoder/events{/privacy}","received_events_url":"https://api.github.com/users/scoder/received_events","type":"User","site_admin":false},"created_at":"2018-12-14T13:58:16Z","updated_at":"2018-12-14T13:58:16Z","author_association":"CONTRIBUTOR","body":"Duplicate of #2584."}}
{"actor":{"display_login":"scoder"}}