{"action":"created","issue":{"url":"https://api.github.com/repos/serge-sans-paille/pythran/issues/1152","repository_url":"https://api.github.com/repos/serge-sans-paille/pythran","labels_url":"https://api.github.com/repos/serge-sans-paille/pythran/issues/1152/labels{/name}","comments_url":"https://api.github.com/repos/serge-sans-paille/pythran/issues/1152/comments","events_url":"https://api.github.com/repos/serge-sans-paille/pythran/issues/1152/events","html_url":"https://github.com/serge-sans-paille/pythran/issues/1152","id":394042288,"node_id":"MDU6SXNzdWUzOTQwNDIyODg=","number":1152,"title":"[BUG] test \"tuple in set\" always returns false","user":{"login":"oscar6echo","id":2219383,"node_id":"MDQ6VXNlcjIyMTkzODM=","avatar_url":"https://avatars3.githubusercontent.com/u/2219383?v=4","gravatar_id":"","url":"https://api.github.com/users/oscar6echo","html_url":"https://github.com/oscar6echo","followers_url":"https://api.github.com/users/oscar6echo/followers","following_url":"https://api.github.com/users/oscar6echo/following{/other_user}","gists_url":"https://api.github.com/users/oscar6echo/gists{/gist_id}","starred_url":"https://api.github.com/users/oscar6echo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oscar6echo/subscriptions","organizations_url":"https://api.github.com/users/oscar6echo/orgs","repos_url":"https://api.github.com/users/oscar6echo/repos","events_url":"https://api.github.com/users/oscar6echo/events{/privacy}","received_events_url":"https://api.github.com/users/oscar6echo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-12-25T18:25:03Z","updated_at":"2018-12-30T21:19:51Z","closed_at":null,"author_association":"NONE","body":"I have the following test in Python code:\r\n```python\r\nfor i in range(100):\r\n    # generate random tuple mytuple - represents a permutation e.g. (1, 3, 2, 4, 0)\r\n    # will generate the same mytuple often\r\n    if mytuple not in myset:\r\n        myset.add(mytuple)\r\n        count += 1\r\n```\r\nIn Python this works as expected.\r\nAfter compilation with Pythran, count is always 100 and greater than len(set).  \r\nSo it seems that the test`mytuple not in myset` always returns false.\r\n\r\nIf I change the line as follows it works - but it slows down the loop considerably.\r\n```python\r\n# very slow\r\nmyset.add('-'.join([str(e) for e in mytuple]))\r\n# almost as slow\r\nmyset.add('-'.join(map(str, mytuple)))\r\n# tried bytes() but not valid\r\nmyset.add(bytes(mytuple))\r\n```\r\nIs this bug known ? planned to be corrected ?\r\nAny faster work around than the clumsy stringification above ?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/serge-sans-paille/pythran/issues/comments/450587357","html_url":"https://github.com/serge-sans-paille/pythran/issues/1152#issuecomment-450587357","issue_url":"https://api.github.com/repos/serge-sans-paille/pythran/issues/1152","id":450587357,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MDU4NzM1Nw==","user":{"login":"serge-sans-paille","id":863807,"node_id":"MDQ6VXNlcjg2MzgwNw==","avatar_url":"https://avatars1.githubusercontent.com/u/863807?v=4","gravatar_id":"","url":"https://api.github.com/users/serge-sans-paille","html_url":"https://github.com/serge-sans-paille","followers_url":"https://api.github.com/users/serge-sans-paille/followers","following_url":"https://api.github.com/users/serge-sans-paille/following{/other_user}","gists_url":"https://api.github.com/users/serge-sans-paille/gists{/gist_id}","starred_url":"https://api.github.com/users/serge-sans-paille/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serge-sans-paille/subscriptions","organizations_url":"https://api.github.com/users/serge-sans-paille/orgs","repos_url":"https://api.github.com/users/serge-sans-paille/repos","events_url":"https://api.github.com/users/serge-sans-paille/events{/privacy}","received_events_url":"https://api.github.com/users/serge-sans-paille/received_events","type":"User","site_admin":false},"created_at":"2018-12-30T21:19:50Z","updated_at":"2018-12-30T21:19:50Z","author_association":"OWNER","body":"The only thing I can think of is a new internal type, ``frozen_list<T>`` that would behave like a tuple of elements of the same time. But then this type would not have a static size which prevents its use as a ndarray shape..."}}
{"actor":{"display_login":"serge-sans-paille"}}