How to create functors?

Ned Deily nad at
Tue Aug 18 23:00:04 CEST 2009

In article 
<5834f36f-b172-4e76-ad90-7056e7097cdd at>,
 Robert Dailey <rcdailey at> wrote:
> I see what you're saying now. However, why am I able to use print as a
> function in general-purpose code in my Python 2.6 script, like so:
> def SomeFunction():
>    print( "Hello World" )

For the same reason you can do this:

>>> x = ( "Hello World" )
>>> type(x)
<type 'str'>

 Ned Deily,
 nad at

More information about the Python-list mailing list