{"action":"closed","issue":{"url":"https://api.github.com/repos/tomerfiliba/rpyc/issues/282","repository_url":"https://api.github.com/repos/tomerfiliba/rpyc","labels_url":"https://api.github.com/repos/tomerfiliba/rpyc/issues/282/labels{/name}","comments_url":"https://api.github.com/repos/tomerfiliba/rpyc/issues/282/comments","events_url":"https://api.github.com/repos/tomerfiliba/rpyc/issues/282/events","html_url":"https://github.com/tomerfiliba/rpyc/issues/282","id":340610697,"node_id":"MDU6SXNzdWUzNDA2MTA2OTc=","number":282,"title":"__eq__ for netref enum objects doesn't work","user":{"login":"shalak","id":1536554,"node_id":"MDQ6VXNlcjE1MzY1NTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1536554?v=4","gravatar_id":"","url":"https://api.github.com/users/shalak","html_url":"https://github.com/shalak","followers_url":"https://api.github.com/users/shalak/followers","following_url":"https://api.github.com/users/shalak/following{/other_user}","gists_url":"https://api.github.com/users/shalak/gists{/gist_id}","starred_url":"https://api.github.com/users/shalak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shalak/subscriptions","organizations_url":"https://api.github.com/users/shalak/orgs","repos_url":"https://api.github.com/users/shalak/repos","events_url":"https://api.github.com/users/shalak/events{/privacy}","received_events_url":"https://api.github.com/users/shalak/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-07-12T12:10:04Z","updated_at":"2018-07-13T11:35:48Z","closed_at":"2018-07-13T11:35:48Z","author_association":"NONE","body":"# Environment:\r\n- rpyc 4.0.1 classic server\r\n- python 3.4\r\n\r\n# Reproduction details\r\nLet's say we have some custom class that implements `__eq__` and has a field that inherits a custom enum class:\r\n\r\n## custom_class.py\r\n```\r\nimport enum\r\n\r\nclass CustomEnum(enum.Enum):\r\n    type1 = 'value1'\r\n    type2 = 'value2'\r\n\r\nclass MyObj:\r\n    def __init__(self, value):\r\n        self.field = value\r\n\r\n    def __eq__(self, other):\r\n        return self.field == other.field\r\n\r\n\r\ndef return_t1():\r\n    return MyObj(CustomEnum.type1)\r\n```\r\n\r\nNow when we compare return values of `return_t1()` from client and server sides it claims to be different.\r\n\r\n## reproduction.py\r\n```\r\nimport rpyc\r\n\r\nimport custom_class\r\n\r\nconn = rpyc.classic.connect('localhost')\r\nconn.modules.sys.path.append(\".\")  # so the RPyC server sees the \"custom_class\" module\r\n\r\n# All of the above should be equal\r\nlocal1_1 = custom_class.return_t1()\r\nlocal1_2 = custom_class.return_t1()\r\n\r\n\r\nremote1_1 = conn.modules.custom_class.return_t1()\r\nremote1_2 = conn.modules.custom_class.return_t1()\r\n\r\n\r\nprint(\"Variables:\")\r\nprint(\"local1_1:\\n\" \\\r\n      \"            id: {}\\n\" \\\r\n      \"          type: {}\\n\" \\\r\n      \"         value: {}\\n\" \\\r\n      \"         field: {}\\n\" \\\r\n      \"    field type: {}\\n\".format(id(local1_1), type(local1_1), local1_1, local1_1.field, type(local1_1.field)))\r\n\r\nprint(\"local1_2:\\n\" \\\r\n      \"            id: {}\\n\" \\\r\n      \"          type: {}\\n\" \\\r\n      \"         value: {}\\n\" \\\r\n      \"         field: {}\\n\" \\\r\n      \"    field type: {}\\n\".format(id(local1_2), type(local1_2), local1_2, local1_2.field, type(local1_2.field)))\r\n\r\nprint(\"remote1_1:\\n\" \\\r\n      \"            id: {}\\n\" \\\r\n      \"          type: {}\\n\" \\\r\n      \"         value: {}\\n\" \\\r\n      \"         field: {}\\n\"\r\n      \"    field type: {}\\n\".format(id(remote1_1), type(remote1_1), remote1_1, remote1_1.field, type(remote1_1.field)))\r\n\r\nprint(\"remote1_2:\\n\" \\\r\n      \"            id: {}\\n\" \\\r\n      \"          type: {}\\n\" \\\r\n      \"         value: {}\\n\" \\\r\n      \"         field: {}\\n\" \\\r\n      \"    field type: {}\\n\".format(id(remote1_2), type(remote1_2), remote1_2, remote1_2.field, type(remote1_2.field)))\r\n\r\nprint(\"All those should be equal:\")\r\nprint(\"              local1_1 == local1_2 ? {}\".format(local1_1 == local1_2))\r\nprint(\"  local1_1.field == local1_2.field ? {}\".format(local1_1.field == local1_2.field))\r\nprint(\"            remote1_1 == remote1_2 ? {}\".format(remote1_1 == remote1_2))\r\nprint(\"remote1_1.field == remote1_2.field ? {}\".format(remote1_1.field == remote1_2.field))\r\nprint(\"             local1_1 == remote1_1 ? {}\".format(local1_1 == remote1_1))\r\nprint(\" local1_1.field == remote1_1.field ? {}\".format(local1_1.field == remote1_1.field))\r\n```\r\n\r\nThe result from above:\r\n\r\n```\r\nVariables:\r\nlocal1_1:\r\n            id: 139789842240176\r\n          type: <class 'custom_class.MyObj'>\r\n         value: <custom_class.MyObj object at 0x7f235be3d2b0>\r\n         field: CustomEnum.type1\r\n    field type: <enum 'CustomEnum'>\r\n\r\nlocal1_2:\r\n            id: 139789842239784\r\n          type: <class 'custom_class.MyObj'>\r\n         value: <custom_class.MyObj object at 0x7f235be3d128>\r\n         field: CustomEnum.type1\r\n    field type: <enum 'CustomEnum'>\r\n\r\nremote1_1:\r\n            id: 139789842220664\r\n          type: <netref class 'custom_class.MyObj'>\r\n         value: <custom_class.MyObj object at 0x7f46d9a03f98>\r\n         field: CustomEnum.type1\r\n    field type: <netref class 'custom_class.CustomEnum'>\r\n\r\nremote1_2:\r\n            id: 139789842221312\r\n          type: <netref class 'custom_class.MyObj'>\r\n         value: <custom_class.MyObj object at 0x7f46d9a03208>\r\n         field: CustomEnum.type1\r\n    field type: <netref class 'custom_class.CustomEnum'>\r\n\r\nAll those should be equal:\r\n              local1_1 == local1_2 ? True\r\n  local1_1.field == local1_2.field ? True\r\n            remote1_1 == remote1_2 ? True\r\nremote1_1.field == remote1_2.field ? True\r\n             local1_1 == remote1_1 ? False\r\n local1_1.field == remote1_1.field ? False\r\n```\r\n"}}
{"actor":{"display_login":"shalak"}}