{"action":"created","comment":{"url":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/comments/44392456","id":44392456,"diff_hunk":"@@ -0,0 +1,108 @@\n+Image\n+*****\n+\n+.. py:module:: microbit\n+\n+Classes\n+=======\n+\n+.. py:class:: Image(width_or_string=None, height=None, buffer=None)\n+\n+    If ``width_or_string`` is a string, creates an image from that string.\n+\n+    If it's an integer, a height has to also be specified, and it creates\n+    an image with ``width_or_string`` columns and ``height`` rows. Optionally\n+    ``buffer`` can be an array of ``width_or_string``×``height`` integers to\n+    initialize the image.","path":"docs/image.rst","position":16,"original_position":16,"commit_id":"fd0ccd8c388b5a5b305ee471379a3a5257d1265a","original_commit_id":"fd0ccd8c388b5a5b305ee471379a3a5257d1265a","user":{"login":"dpgeorge","id":6187689,"avatar_url":"https://avatars.githubusercontent.com/u/6187689?v=3","gravatar_id":"","url":"https://api.github.com/users/dpgeorge","html_url":"https://github.com/dpgeorge","followers_url":"https://api.github.com/users/dpgeorge/followers","following_url":"https://api.github.com/users/dpgeorge/following{/other_user}","gists_url":"https://api.github.com/users/dpgeorge/gists{/gist_id}","starred_url":"https://api.github.com/users/dpgeorge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpgeorge/subscriptions","organizations_url":"https://api.github.com/users/dpgeorge/orgs","repos_url":"https://api.github.com/users/dpgeorge/repos","events_url":"https://api.github.com/users/dpgeorge/events{/privacy}","received_events_url":"https://api.github.com/users/dpgeorge/received_events","type":"User","site_admin":false},"body":"Having 2 constructors is fine, since they use different types for the args as well as different number of args, so it's very unlikely to make a mistake that doesn't raise an exception.\r\n\r\nI'm happy to remove the buffer argument.  I added it at the start thinking it would be useful but I never actually used it.  Initialising with a string is the main way to create an image, but also being able to make a blank image of a given w*h is useful (and I use it).\r\n\r\nWe must remember that the target audience is children and things must stay simple.","created_at":"2015-11-10T10:46:05Z","updated_at":"2015-11-10T10:46:05Z","html_url":"https://github.com/bbcmicrobit/micropython/pull/90#discussion_r44392456","pull_request_url":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/90","_links":{"self":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/comments/44392456"},"html":{"href":"https://github.com/bbcmicrobit/micropython/pull/90#discussion_r44392456"},"pull_request":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/90"}}},"pull_request":{"url":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/90","id":50173362,"html_url":"https://github.com/bbcmicrobit/micropython/pull/90","diff_url":"https://github.com/bbcmicrobit/micropython/pull/90.diff","patch_url":"https://github.com/bbcmicrobit/micropython/pull/90.patch","issue_url":"https://api.github.com/repos/bbcmicrobit/micropython/issues/90","number":90,"state":"open","locked":false,"title":"Initial documentation for the Image class","user":{"login":"deshipu","id":1181357,"avatar_url":"https://avatars.githubusercontent.com/u/1181357?v=3","gravatar_id":"","url":"https://api.github.com/users/deshipu","html_url":"https://github.com/deshipu","followers_url":"https://api.github.com/users/deshipu/followers","following_url":"https://api.github.com/users/deshipu/following{/other_user}","gists_url":"https://api.github.com/users/deshipu/gists{/gist_id}","starred_url":"https://api.github.com/users/deshipu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deshipu/subscriptions","organizations_url":"https://api.github.com/users/deshipu/orgs","repos_url":"https://api.github.com/users/deshipu/repos","events_url":"https://api.github.com/users/deshipu/events{/privacy}","received_events_url":"https://api.github.com/users/deshipu/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-09T20:31:40Z","updated_at":"2015-11-10T10:46:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d380a95673401fbcb36d6c6ae31d29a8196f5332","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/90/commits","review_comments_url":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/90/comments","review_comment_url":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bbcmicrobit/micropython/issues/90/comments","statuses_url":"https://api.github.com/repos/bbcmicrobit/micropython/statuses/fd0ccd8c388b5a5b305ee471379a3a5257d1265a","head":{"label":"deshipu:image-docs","ref":"image-docs","sha":"fd0ccd8c388b5a5b305ee471379a3a5257d1265a","user":{"login":"deshipu","id":1181357,"avatar_url":"https://avatars.githubusercontent.com/u/1181357?v=3","gravatar_id":"","url":"https://api.github.com/users/deshipu","html_url":"https://github.com/deshipu","followers_url":"https://api.github.com/users/deshipu/followers","following_url":"https://api.github.com/users/deshipu/following{/other_user}","gists_url":"https://api.github.com/users/deshipu/gists{/gist_id}","starred_url":"https://api.github.com/users/deshipu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deshipu/subscriptions","organizations_url":"https://api.github.com/users/deshipu/orgs","repos_url":"https://api.github.com/users/deshipu/repos","events_url":"https://api.github.com/users/deshipu/events{/privacy}","received_events_url":"https://api.github.com/users/deshipu/received_events","type":"User","site_admin":false},"repo":{"id":44597197,"name":"micropython-1","full_name":"deshipu/micropython-1","owner":{"login":"deshipu","id":1181357,"avatar_url":"https://avatars.githubusercontent.com/u/1181357?v=3","gravatar_id":"","url":"https://api.github.com/users/deshipu","html_url":"https://github.com/deshipu","followers_url":"https://api.github.com/users/deshipu/followers","following_url":"https://api.github.com/users/deshipu/following{/other_user}","gists_url":"https://api.github.com/users/deshipu/gists{/gist_id}","starred_url":"https://api.github.com/users/deshipu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deshipu/subscriptions","organizations_url":"https://api.github.com/users/deshipu/orgs","repos_url":"https://api.github.com/users/deshipu/repos","events_url":"https://api.github.com/users/deshipu/events{/privacy}","received_events_url":"https://api.github.com/users/deshipu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/deshipu/micropython-1","description":"Port of MicroPython for the BBC micro:bit","fork":true,"url":"https://api.github.com/repos/deshipu/micropython-1","forks_url":"https://api.github.com/repos/deshipu/micropython-1/forks","keys_url":"https://api.github.com/repos/deshipu/micropython-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/deshipu/micropython-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/deshipu/micropython-1/teams","hooks_url":"https://api.github.com/repos/deshipu/micropython-1/hooks","issue_events_url":"https://api.github.com/repos/deshipu/micropython-1/issues/events{/number}","events_url":"https://api.github.com/repos/deshipu/micropython-1/events","assignees_url":"https://api.github.com/repos/deshipu/micropython-1/assignees{/user}","branches_url":"https://api.github.com/repos/deshipu/micropython-1/branches{/branch}","tags_url":"https://api.github.com/repos/deshipu/micropython-1/tags","blobs_url":"https://api.github.com/repos/deshipu/micropython-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/deshipu/micropython-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/deshipu/micropython-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/deshipu/micropython-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/deshipu/micropython-1/statuses/{sha}","languages_url":"https://api.github.com/repos/deshipu/micropython-1/languages","stargazers_url":"https://api.github.com/repos/deshipu/micropython-1/stargazers","contributors_url":"https://api.github.com/repos/deshipu/micropython-1/contributors","subscribers_url":"https://api.github.com/repos/deshipu/micropython-1/subscribers","subscription_url":"https://api.github.com/repos/deshipu/micropython-1/subscription","commits_url":"https://api.github.com/repos/deshipu/micropython-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/deshipu/micropython-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/deshipu/micropython-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/deshipu/micropython-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/deshipu/micropython-1/contents/{+path}","compare_url":"https://api.github.com/repos/deshipu/micropython-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/deshipu/micropython-1/merges","archive_url":"https://api.github.com/repos/deshipu/micropython-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/deshipu/micropython-1/downloads","issues_url":"https://api.github.com/repos/deshipu/micropython-1/issues{/number}","pulls_url":"https://api.github.com/repos/deshipu/micropython-1/pulls{/number}","milestones_url":"https://api.github.com/repos/deshipu/micropython-1/milestones{/number}","notifications_url":"https://api.github.com/repos/deshipu/micropython-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/deshipu/micropython-1/labels{/name}","releases_url":"https://api.github.com/repos/deshipu/micropython-1/releases{/id}","created_at":"2015-10-20T09:52:54Z","updated_at":"2015-10-20T09:52:55Z","pushed_at":"2015-11-10T10:39:50Z","git_url":"git://github.com/deshipu/micropython-1.git","ssh_url":"git@github.com:deshipu/micropython-1.git","clone_url":"https://github.com/deshipu/micropython-1.git","svn_url":"https://github.com/deshipu/micropython-1","homepage":"","size":773,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"bbcmicrobit:master","ref":"master","sha":"24e16bf3b78e014bedb4626f5767a05b3ae441f3","user":{"login":"bbcmicrobit","id":15104236,"avatar_url":"https://avatars.githubusercontent.com/u/15104236?v=3","gravatar_id":"","url":"https://api.github.com/users/bbcmicrobit","html_url":"https://github.com/bbcmicrobit","followers_url":"https://api.github.com/users/bbcmicrobit/followers","following_url":"https://api.github.com/users/bbcmicrobit/following{/other_user}","gists_url":"https://api.github.com/users/bbcmicrobit/gists{/gist_id}","starred_url":"https://api.github.com/users/bbcmicrobit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbcmicrobit/subscriptions","organizations_url":"https://api.github.com/users/bbcmicrobit/orgs","repos_url":"https://api.github.com/users/bbcmicrobit/repos","events_url":"https://api.github.com/users/bbcmicrobit/events{/privacy}","received_events_url":"https://api.github.com/users/bbcmicrobit/received_events","type":"Organization","site_admin":false},"repo":{"id":40358251,"name":"micropython","full_name":"bbcmicrobit/micropython","owner":{"login":"bbcmicrobit","id":15104236,"avatar_url":"https://avatars.githubusercontent.com/u/15104236?v=3","gravatar_id":"","url":"https://api.github.com/users/bbcmicrobit","html_url":"https://github.com/bbcmicrobit","followers_url":"https://api.github.com/users/bbcmicrobit/followers","following_url":"https://api.github.com/users/bbcmicrobit/following{/other_user}","gists_url":"https://api.github.com/users/bbcmicrobit/gists{/gist_id}","starred_url":"https://api.github.com/users/bbcmicrobit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbcmicrobit/subscriptions","organizations_url":"https://api.github.com/users/bbcmicrobit/orgs","repos_url":"https://api.github.com/users/bbcmicrobit/repos","events_url":"https://api.github.com/users/bbcmicrobit/events{/privacy}","received_events_url":"https://api.github.com/users/bbcmicrobit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bbcmicrobit/micropython","description":"Port of MicroPython for the BBC micro:bit","fork":false,"url":"https://api.github.com/repos/bbcmicrobit/micropython","forks_url":"https://api.github.com/repos/bbcmicrobit/micropython/forks","keys_url":"https://api.github.com/repos/bbcmicrobit/micropython/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bbcmicrobit/micropython/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bbcmicrobit/micropython/teams","hooks_url":"https://api.github.com/repos/bbcmicrobit/micropython/hooks","issue_events_url":"https://api.github.com/repos/bbcmicrobit/micropython/issues/events{/number}","events_url":"https://api.github.com/repos/bbcmicrobit/micropython/events","assignees_url":"https://api.github.com/repos/bbcmicrobit/micropython/assignees{/user}","branches_url":"https://api.github.com/repos/bbcmicrobit/micropython/branches{/branch}","tags_url":"https://api.github.com/repos/bbcmicrobit/micropython/tags","blobs_url":"https://api.github.com/repos/bbcmicrobit/micropython/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bbcmicrobit/micropython/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bbcmicrobit/micropython/git/refs{/sha}","trees_url":"https://api.github.com/repos/bbcmicrobit/micropython/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bbcmicrobit/micropython/statuses/{sha}","languages_url":"https://api.github.com/repos/bbcmicrobit/micropython/languages","stargazers_url":"https://api.github.com/repos/bbcmicrobit/micropython/stargazers","contributors_url":"https://api.github.com/repos/bbcmicrobit/micropython/contributors","subscribers_url":"https://api.github.com/repos/bbcmicrobit/micropython/subscribers","subscription_url":"https://api.github.com/repos/bbcmicrobit/micropython/subscription","commits_url":"https://api.github.com/repos/bbcmicrobit/micropython/commits{/sha}","git_commits_url":"https://api.github.com/repos/bbcmicrobit/micropython/git/commits{/sha}","comments_url":"https://api.github.com/repos/bbcmicrobit/micropython/comments{/number}","issue_comment_url":"https://api.github.com/repos/bbcmicrobit/micropython/issues/comments{/number}","contents_url":"https://api.github.com/repos/bbcmicrobit/micropython/contents/{+path}","compare_url":"https://api.github.com/repos/bbcmicrobit/micropython/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bbcmicrobit/micropython/merges","archive_url":"https://api.github.com/repos/bbcmicrobit/micropython/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bbcmicrobit/micropython/downloads","issues_url":"https://api.github.com/repos/bbcmicrobit/micropython/issues{/number}","pulls_url":"https://api.github.com/repos/bbcmicrobit/micropython/pulls{/number}","milestones_url":"https://api.github.com/repos/bbcmicrobit/micropython/milestones{/number}","notifications_url":"https://api.github.com/repos/bbcmicrobit/micropython/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bbcmicrobit/micropython/labels{/name}","releases_url":"https://api.github.com/repos/bbcmicrobit/micropython/releases{/id}","created_at":"2015-08-07T11:58:53Z","updated_at":"2015-11-10T01:47:34Z","pushed_at":"2015-11-10T10:39:50Z","git_url":"git://github.com/bbcmicrobit/micropython.git","ssh_url":"git@github.com:bbcmicrobit/micropython.git","clone_url":"https://github.com/bbcmicrobit/micropython.git","svn_url":"https://github.com/bbcmicrobit/micropython","homepage":"","size":12859,"stargazers_count":99,"watchers_count":99,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":36,"forks":13,"open_issues":36,"watchers":99,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/90"},"html":{"href":"https://github.com/bbcmicrobit/micropython/pull/90"},"issue":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/issues/90"},"comments":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/issues/90/comments"},"review_comments":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/90/comments"},"review_comment":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/90/commits"},"statuses":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/statuses/fd0ccd8c388b5a5b305ee471379a3a5257d1265a"}}}}