view python/bind.py @ 263:7b15ed0b372c

add a sample to bind to an instance, stub
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 15 Feb 2013 15:18:31 -0800
parents
children efeb2cc78f30
line wrap: on
line source

#!/usr/bin/env python

"""
illlustrate e.g. method bind for python
"""

class Foo(object):

    @classmethod
    def create(cls):
        """create an instance and bind a method onto foo"""
              

    def foo(self):
        print "Foo!"