title: Python : comprehension list, square brackets vs list()
body: <p>Hello I could not found the difference between using square brackets for comprehension list versus using list()</p>
  <p>Is there a performance/ memory allocation difference ?</p>
  <p>( same question for set and dict )</p>
  <pre class="lang-py prettyprint-override"><code>input = [1, 2, 3, 4]
  
  B = [a * 2 for a in input if a &gt; 1]
  
  C = list(a * 2 for a in input if a &gt; 1)
  
  B_set = {str(a) for a in input if a &gt; 1}
  
  C_set = set(str(a) for a in input if a &gt; 1)
  
  B_dict = {str(a):a for a in input if a &gt; 1}
  
  C_dict = dict(str(a):b for a,b in input if a &gt; 1) # NOT LEGAL
  </code></pre>
  <p>Thank you for your help</p>