title: Difference between using [] and list() in Python when using with set() function
body: <p>Could anyone tell me why this function work:</p>
  
  <pre><code>def findDisappearedNumbers(self, nums):
      return list(set(range(1,len(nums)+1)) - set(nums))
  </code></pre>
  
  <p>but this function doesn't work:</p>
  
  <pre><code>def findDisappearedNums(self, nums): 
      return [set(range(1, len(nums)+1)) - set(nums)]
  </code></pre>
  
  <p>I would like to use [] instead of list() because [] has a better performance, but using [] with set() function would give me an error while list() with set() function works fine. Thanks.</p>
  
  <pre><code>&gt;&gt;&gt; from timeit import timeit
  &gt;&gt;&gt; timeit("[]")
  0.040084982867934334
  &gt;&gt;&gt; timeit("list()")
  0.17704233359267718enter code here
  </code></pre>