Why are some in-built functions, like range
, map
and zip
, of type type
, while other functions, like, eval
, repr
and sum
, of type builtin_function_or_method
?
I understand that int
, float
, list
, etc. are type type
because they are implemented as classes. But range
, map
and the sort are functions which return iterables. Are these also implemented as classes? If so, why?
Edit: I just noticed that type(range(0,1))
is range
and type(map(func,arr))
is type map
. So they are indeed implemented as classes.
What advantage does this implementation have over implementing them as list
?