On Mon, 10 Dec 2007 03:56:10 -0800, MonkeeSage wrote:

> So, when I say that all callable attributes (or to be more precise, all
> callable attributes bound to objects other than toplevel) are "methods,"
> what am I missing?

Everything that isn't a method but is callable.

class Callable(object):
    def __call__(self):
        return oct(id(self))


class Foo(object):
    aclass = type('Parrot', (object,), {})
    atype = int
    ainstance = Callable()
    afunction = None  # this is tricky...
    def __init__(self):  # a method
        self.afunction = lambda n: n+1



-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to