{"action":"created","issue":{"url":"https://api.github.com/repos/nicoddemus/pytest-issues-migration/issues/44","labels_url":"https://api.github.com/repos/nicoddemus/pytest-issues-migration/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/nicoddemus/pytest-issues-migration/issues/44/comments","events_url":"https://api.github.com/repos/nicoddemus/pytest-issues-migration/issues/44/events","html_url":"https://github.com/nicoddemus/pytest-issues-migration/issues/44","id":85187579,"number":44,"title":"len(list) should be summarized in most cases","user":{"login":"nicoddemus","id":1085180,"avatar_url":"https://avatars.githubusercontent.com/u/1085180?v=3","gravatar_id":"","url":"https://api.github.com/users/nicoddemus","html_url":"https://github.com/nicoddemus","followers_url":"https://api.github.com/users/nicoddemus/followers","following_url":"https://api.github.com/users/nicoddemus/following{/other_user}","gists_url":"https://api.github.com/users/nicoddemus/gists{/gist_id}","starred_url":"https://api.github.com/users/nicoddemus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicoddemus/subscriptions","organizations_url":"https://api.github.com/users/nicoddemus/orgs","repos_url":"https://api.github.com/users/nicoddemus/repos","events_url":"https://api.github.com/users/nicoddemus/events{/privacy}","received_events_url":"https://api.github.com/users/nicoddemus/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-06-04T17:05:19Z","updated_at":"2015-06-04T17:05:21Z","closed_at":"2015-06-04T17:05:20Z","body":"I have some code which runs:\n\n  assert len(mylist) == 2 *** *** 10\n\nWhen this fails, py.test prints out something like:\n\n   + len([something, more, else, thing, bla, ...]) == (2 *** *** 10)\n\nThe problem is that it's impossible to tell exactly why the assert is failing -- the whole list can't reasonably be printed, and truncating the list loses the information that actually matters.\n\nIf a list inside a len is truncated, it would make sense to either display another level of simplification OR to print only the length (since you can't display the whole list).\n\n----------------------------------------\n- Bitbucket: https://bitbucket.org/pytest-dev/pytest/issue/8\n- Originally reported by: [wtanksleyjr](http://bitbucket.org/wtanksleyjr)\n- Originally created at: 2010-11-30T23:36:36.061\n"},"comment":{"url":"https://api.github.com/repos/nicoddemus/pytest-issues-migration/issues/comments/108974291","html_url":"https://github.com/nicoddemus/pytest-issues-migration/issues/44#issuecomment-108974291","issue_url":"https://api.github.com/repos/nicoddemus/pytest-issues-migration/issues/44","id":108974291,"user":{"login":"nicoddemus","id":1085180,"avatar_url":"https://avatars.githubusercontent.com/u/1085180?v=3","gravatar_id":"","url":"https://api.github.com/users/nicoddemus","html_url":"https://github.com/nicoddemus","followers_url":"https://api.github.com/users/nicoddemus/followers","following_url":"https://api.github.com/users/nicoddemus/following{/other_user}","gists_url":"https://api.github.com/users/nicoddemus/gists{/gist_id}","starred_url":"https://api.github.com/users/nicoddemus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicoddemus/subscriptions","organizations_url":"https://api.github.com/users/nicoddemus/orgs","repos_url":"https://api.github.com/users/nicoddemus/repos","events_url":"https://api.github.com/users/nicoddemus/events{/privacy}","received_events_url":"https://api.github.com/users/nicoddemus/received_events","type":"User","site_admin":false},"created_at":"2015-06-04T17:05:21Z","updated_at":"2015-06-04T17:05:21Z","body":"Hi\r\n\r\nI've had a look at this and it seems that the code actually goes out of it's way to hide the actual value the function evaluates for builtin functions as well as for functions which return a boolean.  After applying the attached patch your test3.py shows as:\r\n\r\n{{{\r\npy.test test3.py \r\n============================= test session starts ==============================\r\nplatform linux2 -- Python 2.6.6 -- pytest-2.0.1.dev5\r\ncollected 1 items \r\n\r\ntest3.py F\r\n\r\n=================================== FAILURES ===================================\r\n_____________________________ test_show_long_list ______________________________\r\n\r\n    def test_show_long_list():\r\n        x = list(range(1,2**10))\r\n>       assert len(x) == 2**11\r\nE       assert 1023 == (2 ** 11)\r\nE        +  where 1023 = len([1, 2, 3, 4, 5, 6, ...])\r\n\r\ntest3.py:3: AssertionError\r\n=========================== 1 failed in 0.05 seconds ===========================\r\n}}}\r\n\r\nTo me this seems like enough, what do others think?\r\n\r\nHowever since this was explicitly done and even mentioned in the comments I wonder if someone still knows what the reason was to do this?\r\n\r\nRegards\r\nFloris\n\n----------------------------------------\nOriginal comment by: Floris Bruynooghe\n"}}