0

I've used Boost.Python to expose my class into Python. I want to change this class or override some parts of it in Python as well as what we can do on classes in Python by default.

Novin Shahroudi
  • 620
  • 8
  • 18

2 Answers2

1

You should be able to make a subclass, like:

class Subclass(MyBoostPythonClass):
     # your modifications / extensions ...
Albert
  • 65,406
  • 61
  • 242
  • 386
1

It sounds like you want to subclass, which would be the other answer provided; however if you are looking to change an objects class on-the-fly, you could use object.__class__ = NewClass -- though this may be considered EVIL in some (probably most) circles.

Riz
  • 348
  • 1
  • 5