title: How does the map() run in Python?
body: <p>I want to find how <code>map()</code> runs in Python and read its output, so that I tried some codes like the below. But I can't understand yet about <code>map object</code> and the flow of data from <code>input()</code> to <code>print()</code>.</p>
  <ul>
  <li>Codes</li>
  </ul>
  <pre><code>def details(txt) :
      print(&quot;elements :&quot;, txt)
      print(&quot;type :&quot;, type(txt))
      try :
          print(&quot;elements' type :&quot;, type(txt[0]), &quot;\n&quot;)
      except :
          print(&quot;elements' type : an error occurs.\n&quot;)
  
  txt = &quot;1 2 3 4 5&quot;
  details(txt)
  
  txtsplit = txt.split()
  details(txtsplit)
  
  txtmap = map(int, txt.split())
  details(txtmap) # an error occurs
  
  txtlist = list(txtmap)
  details(txtlist)
  </code></pre>
  <ul>
  <li>Results</li>
  </ul>
  <pre><code>elements : 1 2 3 4 5
  type : &lt;class 'str'&gt;
  elements' type : &lt;class 'str'&gt;
  
  elements : ['1', '2', '3', '4', '5']
  type : &lt;class 'list'&gt;
  elements' type : &lt;class 'str'&gt;
  
  elements : &lt;map object at 0x7fefcdfe8dc0&gt;
  type : &lt;class 'map'&gt;
  elements' type : an error occurs.
  
  elements : [1, 2, 3, 4, 5]
  type : &lt;class 'list'&gt;
  elements' type : &lt;class 'int'&gt;
  </code></pre>
  <p>Is there some way to read the original figure of the <code>map object</code>?</p>
  <p>I know the common use of combination with <code>list()</code>, so hope to emphasize that my question is neither about its grammarical usage nor about solving the error.</p>
  <p>Thank you for you help!</p>