I want to create an array with objects, using map function:
class Something:
def __init__( self, number ):
...
def new_object( x ):
return Something(x)
map( new_object, [1,2,3,4] )
Is there default python syntax equivalent to new_object? something like Something.new(x), that I could pass to map?
(I don’t ask for lambda function, I ask for some built-in class-level function. I just want to avoid this new_object if there is a built-in equivalent)
Straightforwardly: