{"action":"created","comment":{"url":"https://api.github.com/repos/pybee/batavia/pulls/comments/80380087","id":80380087,"diff_hunk":"@@ -72,14 +71,29 @@ batavia.types.List = function() {\n     List.prototype.__lt__ = function(other) {\n \n \n-        if(batavia.isinstance(other, [batavia.types.Bytes, batavia.types.Bytearray])){\n+        if (batavia.isinstance(other, [batavia.types.Bytes, batavia.types.Bytearray])){\n             throw new batavia.builtins.TypeError(\"unorderable types: list() < \" + batavia.type_name(other) + \"()\")\n         }\n \n         if (other !== null) {\n             if (batavia.isinstance(other, batavia.types.List)) {\n-                /* update this line to get Pythonic list < list behavior */\n-                return this.valueOf() < other;\n+                // edge case where this==[]\n+                if (this.length === 0 && other.length > 0){\n+                    return true;\n+                }\n+\n+                for (var i=0; i<this.length; i++){\n+\n+                    //other ran out of items.\n+                    if (other[i] === undefined){\n+                        return false;\n+                    }\n+                    if (this[i].__ne__(other[i])){\n+                        return this[i].__lt__(other[i]);\n+                    }\n+                }\n+                //got through loop and all values were equal. Determine by comparing length\n+                return this.length < other.length;","path":"batavia/types/List.js","position":37,"original_position":37,"commit_id":"4c49fd4d7b14f7ce431dbda4e42d4fc43b5366a6","original_commit_id":"2adbf7a674161f9d79edef2a33768d36b3714f73","user":{"login":"jstoebel","id":12101566,"avatar_url":"https://avatars.githubusercontent.com/u/12101566?v=3","gravatar_id":"","url":"https://api.github.com/users/jstoebel","html_url":"https://github.com/jstoebel","followers_url":"https://api.github.com/users/jstoebel/followers","following_url":"https://api.github.com/users/jstoebel/following{/other_user}","gists_url":"https://api.github.com/users/jstoebel/gists{/gist_id}","starred_url":"https://api.github.com/users/jstoebel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jstoebel/subscriptions","organizations_url":"https://api.github.com/users/jstoebel/orgs","repos_url":"https://api.github.com/users/jstoebel/repos","events_url":"https://api.github.com/users/jstoebel/events{/privacy}","received_events_url":"https://api.github.com/users/jstoebel/received_events","type":"User","site_admin":false},"body":"Thanks for the input! I'm a little confused about comparing lengths first. My understanding of the behavior was that we compare the first item of both lists, then the second and so on. When a non equal elements are found, their result is the result of the comparison. Comparing just the length of two lists doesn't alone tell us how they compare, we need to compare elements one by one. Example:\r\n\r\n```\r\n>>> [3,4] > [1,2,3]\r\nTrue\r\n```\r\nWhat am I missing?\r\n\r\nsource: https://docs.python.org/3/tutorial/datastructures.html#comparing-sequences-and-other-types","created_at":"2016-09-25T11:36:58Z","updated_at":"2016-09-25T11:36:58Z","html_url":"https://github.com/pybee/batavia/pull/269#discussion_r80380087","pull_request_url":"https://api.github.com/repos/pybee/batavia/pulls/269","_links":{"self":{"href":"https://api.github.com/repos/pybee/batavia/pulls/comments/80380087"},"html":{"href":"https://github.com/pybee/batavia/pull/269#discussion_r80380087"},"pull_request":{"href":"https://api.github.com/repos/pybee/batavia/pulls/269"}}},"pull_request":{"url":"https://api.github.com/repos/pybee/batavia/pulls/269","id":85963283,"html_url":"https://github.com/pybee/batavia/pull/269","diff_url":"https://github.com/pybee/batavia/pull/269.diff","patch_url":"https://github.com/pybee/batavia/pull/269.patch","issue_url":"https://api.github.com/repos/pybee/batavia/issues/269","number":269,"state":"open","locked":false,"title":"List comparison list","user":{"login":"jstoebel","id":12101566,"avatar_url":"https://avatars.githubusercontent.com/u/12101566?v=3","gravatar_id":"","url":"https://api.github.com/users/jstoebel","html_url":"https://github.com/jstoebel","followers_url":"https://api.github.com/users/jstoebel/followers","following_url":"https://api.github.com/users/jstoebel/following{/other_user}","gists_url":"https://api.github.com/users/jstoebel/gists{/gist_id}","starred_url":"https://api.github.com/users/jstoebel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jstoebel/subscriptions","organizations_url":"https://api.github.com/users/jstoebel/orgs","repos_url":"https://api.github.com/users/jstoebel/repos","events_url":"https://api.github.com/users/jstoebel/events{/privacy}","received_events_url":"https://api.github.com/users/jstoebel/received_events","type":"User","site_admin":false},"body":"completed comparisons for\r\n\r\n- List > List\r\n- List >= List\r\n- List < List\r\n- List <= List","created_at":"2016-09-20T12:16:04Z","updated_at":"2016-09-25T11:36:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"004aeb278a64988555e9491486df0100bb2a1b8c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/pybee/batavia/pulls/269/commits","review_comments_url":"https://api.github.com/repos/pybee/batavia/pulls/269/comments","review_comment_url":"https://api.github.com/repos/pybee/batavia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pybee/batavia/issues/269/comments","statuses_url":"https://api.github.com/repos/pybee/batavia/statuses/4c49fd4d7b14f7ce431dbda4e42d4fc43b5366a6","head":{"label":"jstoebel:List_comparison_List","ref":"List_comparison_List","sha":"4c49fd4d7b14f7ce431dbda4e42d4fc43b5366a6","user":{"login":"jstoebel","id":12101566,"avatar_url":"https://avatars.githubusercontent.com/u/12101566?v=3","gravatar_id":"","url":"https://api.github.com/users/jstoebel","html_url":"https://github.com/jstoebel","followers_url":"https://api.github.com/users/jstoebel/followers","following_url":"https://api.github.com/users/jstoebel/following{/other_user}","gists_url":"https://api.github.com/users/jstoebel/gists{/gist_id}","starred_url":"https://api.github.com/users/jstoebel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jstoebel/subscriptions","organizations_url":"https://api.github.com/users/jstoebel/orgs","repos_url":"https://api.github.com/users/jstoebel/repos","events_url":"https://api.github.com/users/jstoebel/events{/privacy}","received_events_url":"https://api.github.com/users/jstoebel/received_events","type":"User","site_admin":false},"repo":{"id":64568172,"name":"batavia","full_name":"jstoebel/batavia","owner":{"login":"jstoebel","id":12101566,"avatar_url":"https://avatars.githubusercontent.com/u/12101566?v=3","gravatar_id":"","url":"https://api.github.com/users/jstoebel","html_url":"https://github.com/jstoebel","followers_url":"https://api.github.com/users/jstoebel/followers","following_url":"https://api.github.com/users/jstoebel/following{/other_user}","gists_url":"https://api.github.com/users/jstoebel/gists{/gist_id}","starred_url":"https://api.github.com/users/jstoebel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jstoebel/subscriptions","organizations_url":"https://api.github.com/users/jstoebel/orgs","repos_url":"https://api.github.com/users/jstoebel/repos","events_url":"https://api.github.com/users/jstoebel/events{/privacy}","received_events_url":"https://api.github.com/users/jstoebel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jstoebel/batavia","description":"A Javascript implementation of the Python virtual machine.","fork":true,"url":"https://api.github.com/repos/jstoebel/batavia","forks_url":"https://api.github.com/repos/jstoebel/batavia/forks","keys_url":"https://api.github.com/repos/jstoebel/batavia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jstoebel/batavia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jstoebel/batavia/teams","hooks_url":"https://api.github.com/repos/jstoebel/batavia/hooks","issue_events_url":"https://api.github.com/repos/jstoebel/batavia/issues/events{/number}","events_url":"https://api.github.com/repos/jstoebel/batavia/events","assignees_url":"https://api.github.com/repos/jstoebel/batavia/assignees{/user}","branches_url":"https://api.github.com/repos/jstoebel/batavia/branches{/branch}","tags_url":"https://api.github.com/repos/jstoebel/batavia/tags","blobs_url":"https://api.github.com/repos/jstoebel/batavia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jstoebel/batavia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jstoebel/batavia/git/refs{/sha}","trees_url":"https://api.github.com/repos/jstoebel/batavia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jstoebel/batavia/statuses/{sha}","languages_url":"https://api.github.com/repos/jstoebel/batavia/languages","stargazers_url":"https://api.github.com/repos/jstoebel/batavia/stargazers","contributors_url":"https://api.github.com/repos/jstoebel/batavia/contributors","subscribers_url":"https://api.github.com/repos/jstoebel/batavia/subscribers","subscription_url":"https://api.github.com/repos/jstoebel/batavia/subscription","commits_url":"https://api.github.com/repos/jstoebel/batavia/commits{/sha}","git_commits_url":"https://api.github.com/repos/jstoebel/batavia/git/commits{/sha}","comments_url":"https://api.github.com/repos/jstoebel/batavia/comments{/number}","issue_comment_url":"https://api.github.com/repos/jstoebel/batavia/issues/comments{/number}","contents_url":"https://api.github.com/repos/jstoebel/batavia/contents/{+path}","compare_url":"https://api.github.com/repos/jstoebel/batavia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jstoebel/batavia/merges","archive_url":"https://api.github.com/repos/jstoebel/batavia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jstoebel/batavia/downloads","issues_url":"https://api.github.com/repos/jstoebel/batavia/issues{/number}","pulls_url":"https://api.github.com/repos/jstoebel/batavia/pulls{/number}","milestones_url":"https://api.github.com/repos/jstoebel/batavia/milestones{/number}","notifications_url":"https://api.github.com/repos/jstoebel/batavia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jstoebel/batavia/labels{/name}","releases_url":"https://api.github.com/repos/jstoebel/batavia/releases{/id}","deployments_url":"https://api.github.com/repos/jstoebel/batavia/deployments","created_at":"2016-07-30T23:26:32Z","updated_at":"2016-07-30T23:26:33Z","pushed_at":"2016-09-25T11:34:43Z","git_url":"git://github.com/jstoebel/batavia.git","ssh_url":"git@github.com:jstoebel/batavia.git","clone_url":"https://github.com/jstoebel/batavia.git","svn_url":"https://github.com/jstoebel/batavia","homepage":"http://pybee.org/batavia","size":19191,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"pybee:master","ref":"master","sha":"a7dd875817991cc36498b6d5bc384c018dd6de32","user":{"login":"pybee","id":5001767,"avatar_url":"https://avatars.githubusercontent.com/u/5001767?v=3","gravatar_id":"","url":"https://api.github.com/users/pybee","html_url":"https://github.com/pybee","followers_url":"https://api.github.com/users/pybee/followers","following_url":"https://api.github.com/users/pybee/following{/other_user}","gists_url":"https://api.github.com/users/pybee/gists{/gist_id}","starred_url":"https://api.github.com/users/pybee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pybee/subscriptions","organizations_url":"https://api.github.com/users/pybee/orgs","repos_url":"https://api.github.com/users/pybee/repos","events_url":"https://api.github.com/users/pybee/events{/privacy}","received_events_url":"https://api.github.com/users/pybee/received_events","type":"Organization","site_admin":false},"repo":{"id":40421806,"name":"batavia","full_name":"pybee/batavia","owner":{"login":"pybee","id":5001767,"avatar_url":"https://avatars.githubusercontent.com/u/5001767?v=3","gravatar_id":"","url":"https://api.github.com/users/pybee","html_url":"https://github.com/pybee","followers_url":"https://api.github.com/users/pybee/followers","following_url":"https://api.github.com/users/pybee/following{/other_user}","gists_url":"https://api.github.com/users/pybee/gists{/gist_id}","starred_url":"https://api.github.com/users/pybee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pybee/subscriptions","organizations_url":"https://api.github.com/users/pybee/orgs","repos_url":"https://api.github.com/users/pybee/repos","events_url":"https://api.github.com/users/pybee/events{/privacy}","received_events_url":"https://api.github.com/users/pybee/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pybee/batavia","description":"A Javascript implementation of the Python virtual machine.","fork":false,"url":"https://api.github.com/repos/pybee/batavia","forks_url":"https://api.github.com/repos/pybee/batavia/forks","keys_url":"https://api.github.com/repos/pybee/batavia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pybee/batavia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pybee/batavia/teams","hooks_url":"https://api.github.com/repos/pybee/batavia/hooks","issue_events_url":"https://api.github.com/repos/pybee/batavia/issues/events{/number}","events_url":"https://api.github.com/repos/pybee/batavia/events","assignees_url":"https://api.github.com/repos/pybee/batavia/assignees{/user}","branches_url":"https://api.github.com/repos/pybee/batavia/branches{/branch}","tags_url":"https://api.github.com/repos/pybee/batavia/tags","blobs_url":"https://api.github.com/repos/pybee/batavia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pybee/batavia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pybee/batavia/git/refs{/sha}","trees_url":"https://api.github.com/repos/pybee/batavia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pybee/batavia/statuses/{sha}","languages_url":"https://api.github.com/repos/pybee/batavia/languages","stargazers_url":"https://api.github.com/repos/pybee/batavia/stargazers","contributors_url":"https://api.github.com/repos/pybee/batavia/contributors","subscribers_url":"https://api.github.com/repos/pybee/batavia/subscribers","subscription_url":"https://api.github.com/repos/pybee/batavia/subscription","commits_url":"https://api.github.com/repos/pybee/batavia/commits{/sha}","git_commits_url":"https://api.github.com/repos/pybee/batavia/git/commits{/sha}","comments_url":"https://api.github.com/repos/pybee/batavia/comments{/number}","issue_comment_url":"https://api.github.com/repos/pybee/batavia/issues/comments{/number}","contents_url":"https://api.github.com/repos/pybee/batavia/contents/{+path}","compare_url":"https://api.github.com/repos/pybee/batavia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pybee/batavia/merges","archive_url":"https://api.github.com/repos/pybee/batavia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pybee/batavia/downloads","issues_url":"https://api.github.com/repos/pybee/batavia/issues{/number}","pulls_url":"https://api.github.com/repos/pybee/batavia/pulls{/number}","milestones_url":"https://api.github.com/repos/pybee/batavia/milestones{/number}","notifications_url":"https://api.github.com/repos/pybee/batavia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pybee/batavia/labels{/name}","releases_url":"https://api.github.com/repos/pybee/batavia/releases{/id}","deployments_url":"https://api.github.com/repos/pybee/batavia/deployments","created_at":"2015-08-09T01:40:34Z","updated_at":"2016-09-22T17:59:45Z","pushed_at":"2016-09-25T11:34:44Z","git_url":"git://github.com/pybee/batavia.git","ssh_url":"git@github.com:pybee/batavia.git","clone_url":"https://github.com/pybee/batavia.git","svn_url":"https://github.com/pybee/batavia","homepage":"http://pybee.org/batavia","size":19842,"stargazers_count":375,"watchers_count":375,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":135,"mirror_url":null,"open_issues_count":26,"forks":135,"open_issues":26,"watchers":375,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pybee/batavia/pulls/269"},"html":{"href":"https://github.com/pybee/batavia/pull/269"},"issue":{"href":"https://api.github.com/repos/pybee/batavia/issues/269"},"comments":{"href":"https://api.github.com/repos/pybee/batavia/issues/269/comments"},"review_comments":{"href":"https://api.github.com/repos/pybee/batavia/pulls/269/comments"},"review_comment":{"href":"https://api.github.com/repos/pybee/batavia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pybee/batavia/pulls/269/commits"},"statuses":{"href":"https://api.github.com/repos/pybee/batavia/statuses/4c49fd4d7b14f7ce431dbda4e42d4fc43b5366a6"}}}}
{"actor":{"display_login":"jstoebel"}}