{"action":"created","issue":{"url":"https://api.github.com/repos/pybee/voc/issues/38","repository_url":"https://api.github.com/repos/pybee/voc","labels_url":"https://api.github.com/repos/pybee/voc/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/pybee/voc/issues/38/comments","events_url":"https://api.github.com/repos/pybee/voc/issues/38/events","html_url":"https://github.com/pybee/voc/issues/38","id":120507015,"number":38,"title":"Complete implementation of methods on standard types","user":{"login":"freakboy3742","id":37345,"avatar_url":"https://avatars.githubusercontent.com/u/37345?v=3","gravatar_id":"","url":"https://api.github.com/users/freakboy3742","html_url":"https://github.com/freakboy3742","followers_url":"https://api.github.com/users/freakboy3742/followers","following_url":"https://api.github.com/users/freakboy3742/following{/other_user}","gists_url":"https://api.github.com/users/freakboy3742/gists{/gist_id}","starred_url":"https://api.github.com/users/freakboy3742/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freakboy3742/subscriptions","organizations_url":"https://api.github.com/users/freakboy3742/orgs","repos_url":"https://api.github.com/users/freakboy3742/repos","events_url":"https://api.github.com/users/freakboy3742/events{/privacy}","received_events_url":"https://api.github.com/users/freakboy3742/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pybee/voc/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/pybee/voc/labels/first-timers-only","name":"first-timers-only","color":"fad8c7"},{"url":"https://api.github.com/repos/pybee/voc/labels/up-fo-grabs","name":"up-fo-grabs","color":"159818"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-12-04T23:26:41Z","updated_at":"2016-04-03T06:48:08Z","closed_at":null,"body":"The builtin types of Python have a number of methods associated with them - for example, `dict` objects have `update()`, `items()`, `keys()`, `pop()` and so on. These methods need to be implemented in Java. In many cases, there will be a simple mapping to an analogous function in the underlying Java type; however, sometimes you'll need to write an implementation using the available Java primitives.\r\n\r\nTests are are also required; they should go in the module corresponding to the data type [in the tests/datatypes directory](https://github.com/pybee/voc/blob/master/tests/datatypes).\r\n\r\nTests are based on comparing the output of some sample Python code when run through CPython to the output when run through VOC. When the two outputs are identical - and I mean byte-identical, down to the text and punctuation of the error message if appropriate - the test passes.\r\n\r\nIf you want an example to follow, look at [the implementation of `clear()` on `dict`](https://github.com/pybee/voc/blob/master/python/common/org/python/types/Dict.java#L120):\r\n* The `@org.python.Method` annotation is used to expose the clear() method as a symbol that should be available at runtime. \r\n* All arguments are exposed as org.python.Object, and then cast to the right data type as required.\r\n* Finally, the method returns a Python `None`.\r\n"},"comment":{"url":"https://api.github.com/repos/pybee/voc/issues/comments/204890728","html_url":"https://github.com/pybee/voc/issues/38#issuecomment-204890728","issue_url":"https://api.github.com/repos/pybee/voc/issues/38","id":204890728,"user":{"login":"cflee","id":8225175,"avatar_url":"https://avatars.githubusercontent.com/u/8225175?v=3","gravatar_id":"","url":"https://api.github.com/users/cflee","html_url":"https://github.com/cflee","followers_url":"https://api.github.com/users/cflee/followers","following_url":"https://api.github.com/users/cflee/following{/other_user}","gists_url":"https://api.github.com/users/cflee/gists{/gist_id}","starred_url":"https://api.github.com/users/cflee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cflee/subscriptions","organizations_url":"https://api.github.com/users/cflee/orgs","repos_url":"https://api.github.com/users/cflee/repos","events_url":"https://api.github.com/users/cflee/events{/privacy}","received_events_url":"https://api.github.com/users/cflee/received_events","type":"User","site_admin":false},"created_at":"2016-04-03T06:48:08Z","updated_at":"2016-04-03T06:48:08Z","body":"I was looking at implementing the `NotImplemented -> TypeError` bit in `COMPARE_OP`, but just to make sure I'm on the right track - this is where the ['reflected operations'](https://docs.python.org/3/reference/datamodel.html#object.__lt__) need to be dealt with right? \r\n\r\nOr in other words, should the `COMPARE_OP` Python opcode be where we check if `y` is a subclass of `x` (but not the same class), and whether the operations return `NotImplemented`?"}}