[Tutor] random.choice()

Kent Johnson kent37 at tds.net
Wed Jul 2 18:14:36 CEST 2008

On Wed, Jul 2, 2008 at 11:50 AM, Dick Moores <rdm at rcblue.com> wrote:

> It seems to me that Wes is saying only that all function objects are
> callable, not that all callable objects are functions.

Wesley said that function objects have a "heaping distinction" of
being callable. Only he can say for sure what that means; I took it to
mean that being callable is a very special property, perhaps one that
only function objects have. I just wanted to point out that there is
nothing really very special about that property, any more than being
iterable or having a length or a string representation or any of the
other properties that are implemented with special methods.

> Are there function
> objects that aren't callable?

Not that I can think of off-hand though maybe there is some pathological case...

> Your example is a callable object that isn't a
> function, right?

Yes, my point is that it is very easy to create such an object.


More information about the Tutor mailing list