title: When is it best to use a python map function with a user defined function with parentheses or without parentheses
body: <p>Sorry if this sound like a dumb question, I really do not understand why am i getting values back and why the complier is not screaming error, first the below code  the function add_to_five receive an (x) in the (parentheses) and return the value of x + 5; however when called in the map function i only pass in add_to_five without parentheses and provided a iterable sequence of l for the second arg and the new_value is [6, 7, 8, 9, 10]</p>
  <p>how is x getting assigned, when called in the the map the add_to_five clearly does not get the parentheses explicitly assigned and the value of (x) is not provided to the function, however some how l is been replaced into the parentheses of add_to_five that why the result is [6, 7, 8, 9, 10].</p>
  <p>when i take away (x +) in the return and just return only 5 though still left an (x) in the parentheses of add_to_five the new_value become [5,5,5,5,5] and i do not get an error when add_to_five referenced in the map function.</p>
  <p>why does add_to_five work in the map function with out parentheses and also worked when i returned just (5) and still leave the (x) in the parentheses with out binding (x) to anything or value (5).</p>
  <p>when is it best to use a function with parentheses as i know when invoked (type of add_to_five(5)) it return (int) as object type and when invoked (type of add_to_five) it returns function and random memory address.</p>
  <p>I know lambda is a way to work around but not looking for quick solution thank you.</p>
  <pre><code>def add_to_five(x):
  
          return x + 5
   
      l = [1, 2, 3, 4, 5]
  
  new_value = list(map(add_to_five, l))
  print(new_value)
  </code></pre>