adding methods on the fly

David LeBlanc whisper at oz.net
Fri Jul 5 14:47:34 EDT 2002


Have you looked at Boost? www.boost.org

David LeBlanc
Seattle, WA USA

> -----Original Message-----
> From: python-list-admin at python.org
> [mailto:python-list-admin at python.org]On Behalf Of Renzo Tomaselli
> Sent: Friday, July 05, 2002 9:14
> To: python-list at python.org
> Subject: adding methods on the fly
>
>
> Hi all,
>     after a long and unsuccessful search about extending C++ classes by
> Python methods, I came up to the point where a couple of basic questions
> should be answered:
>
> 1. Can we add new (Python) methods to a C object wrapper, e.g.
> after it has
> been instantiated with a normal (C) method table ?
> 2. if not: can we add a new method to an already imported Python
> class ? If
> yes, how can we do it, assuming to start from a method statement
> hosted by a
> string ?
>
> I understand that the latest version (2.2.1) allows for defining a class
> which inherits from a C type, so that we can define some Python methods on
> it, while retaining the capability of inherited C methods.
> The point is that I want to add Python methods on demand to such class.
> Thanks,
>
> Renzo Tomaselli
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list






More information about the Python-list mailing list