passing arguments to a function - do I need type ?

Philipp H. Mohr phm4 at kent.ac.uk
Sun Jul 10 11:37:36 EDT 2005


Hello,

thank you very much for all your help. I have solved the problem - you
guys where right, the problem was some where else.

I have another class which got an accessor:

def getCenter(self):
        global center
        return center


and I called it by saying n.getCenter, but this returns:

<bound method ARBgps.getCenter of <__main__.ARBgps instance at
0xb7c368ec>>

I changed it to n.getCenter() and now it works. Despite some small
problems I am really getting to like python.

Thank you,
Phil


On Sun, 10 Jul 2005, Paul McGuire wrote:

> Is getCenter a function?  If so, you need to invoke distance using:
>     dist = self.distance( n.getCenter(), newElement )
>
> Of course, that is assuming that newElement is a local variable of type
> list/tuple/etc.
>
> -- Paul
>
>



More information about the Python-list mailing list