{"action":"closed","issue":{"url":"https://api.github.com/repos/nltk/nltk_book/issues/138","labels_url":"https://api.github.com/repos/nltk/nltk_book/issues/138/labels{/name}","comments_url":"https://api.github.com/repos/nltk/nltk_book/issues/138/comments","events_url":"https://api.github.com/repos/nltk/nltk_book/issues/138/events","html_url":"https://github.com/nltk/nltk_book/issues/138","id":72261514,"number":138,"title":"map - Section 4.5 - subsection Higher-Order Functions","user":{"login":"PeterHancox","id":12190634,"avatar_url":"https://avatars.githubusercontent.com/u/12190634?v=3","gravatar_id":"","url":"https://api.github.com/users/PeterHancox","html_url":"https://github.com/PeterHancox","followers_url":"https://api.github.com/users/PeterHancox/followers","following_url":"https://api.github.com/users/PeterHancox/following{/other_user}","gists_url":"https://api.github.com/users/PeterHancox/gists{/gist_id}","starred_url":"https://api.github.com/users/PeterHancox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PeterHancox/subscriptions","organizations_url":"https://api.github.com/users/PeterHancox/orgs","repos_url":"https://api.github.com/users/PeterHancox/repos","events_url":"https://api.github.com/users/PeterHancox/events{/privacy}","received_events_url":"https://api.github.com/users/PeterHancox/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-30T19:38:03Z","updated_at":"2015-05-25T03:48:54Z","closed_at":"2015-05-25T03:48:54Z","body":"1st map example isn't giving the same output in Python 3.4:\r\n\r\n>>> lengths = map(len, nltk.corpus.brown.sents(categories='news'))\r\n>>> sum(lengths) / len(lengths)\r\nTraceback (most recent call last):\r\n  File \"<pyshell#8>\", line 1, in <module>\r\n    sum(lengths) / len(lengths)\r\nTypeError: object of type 'map' has no len()\r\n>>> lengths = [len(sent) for sent in nltk.corpus.brown.sents(categories='news')]\r\n>>> sum(lengths) / len(lengths)\r\n21.75081116158339\r\n"}}