Wouldn't it be nice if this worked?

Calvin Spealman ironfroggy at gmail.com
Sun Aug 10 21:49:32 CEST 2008


dont quote me but i do think this check is being removed.

On Sun, Aug 10, 2008 at 3:42 PM, Patrick Mullen <saluk64007 at gmail.com> wrote:
> How about:
>
> class A:
>    def add(self,x,y):
>        return x+y
>
> class B(A):
>    pass
>
> print B().add(1, 2)
>
>
>
> This also works:
>
> class A:
>   def add(self, x, y):
>       return x+y
>
> class B:
>   pass
>
> B.add = A.add.im_func
> print B().add(1, 2)
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
Read my blog! I depend on your acceptance of my opinion! I am interesting!
http://ironfroggy-code.blogspot.com/



More information about the Python-list mailing list