Gilch illustrated the difference between a function and a callable
This part still seems confused. What you remember about this part isn’t quite what I was trying to say. Functions are callables, but they’re not the only type of callable. Classes are also callable, for example. Lambdas are of the function type in Python, so these aren’t exactly separate categories.
>>> type(lambda:0)
<class 'function'>
Callables are anything you can call; they understand the function call operator. You can use the builtin predicate callable to tell if an object is callable or not.
This part still seems confused. What you remember about this part isn’t quite what I was trying to say. Functions are callables, but they’re not the only type of callable. Classes are also callable, for example. Lambdas are of the function type in Python, so these aren’t exactly separate categories.
Callables are anything you can call; they understand the function call operator. You can use the builtin predicate
callable
to tell if an object is callable or not.