Objects in Python

John Gordon gordon at panix.com
Wed Aug 22 11:03:51 EDT 2012


In <18409992-1e28-4721-8e64-60c69668da4e at googlegroups.com> shaun <shaun.wiseman91 at gmail.com> writes:

> I'm having an issue its my first time using python and i set up a class one of the methods is supposed to return a string but instead returns:

> <bound method Param.returnString of <Param.Param instance at 0x00C
> 389E0>>

It looks like you're referencing the method object itself, instead of
calling it method.  In other words, you've left off the parentheses.

I.e. you're doing something like this:

    print my_object.foo

Instead of this:

    print my_object.foo()

-- 
John Gordon                   A is for Amy, who fell down the stairs
gordon at panix.com              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"




More information about the Python-list mailing list