[Tutor] repr()

Terry Carroll carroll at tjc.com
Tue Jun 7 22:29:31 CEST 2005


On Tue, 7 Jun 2005, Bernard Lebel wrote:

> repr( myFunc )
> '<function myFunc at 0x009C6630>'
> 
> 
> 
> s = repr( myFunc() )
> print s
> 
> 'None'

In the first example, your repr invocation is:

  repr(myFunc)

i.e., you're asking for the repr of the function myFunc.

In the second example, your repr invocation is:

  repr(myFunc())

i.e., you're calling the function myFunc and asking for the repr of the 
*result*



More information about the Tutor mailing list