|
registering simple conversions from/to python: msg#00219python.c++
I'd like to pythonise my classes a little by allowing tuples to be passed to and from the data values. In python in would look something like this: class C(object): def __init__(self, x=0.0, y=0.0): self.x = x self.y = y def get_xy(self): return self.x, self.y def set_xy(self, xy): self.x, self.y = xy xy = property(get_xy, set_xy) I guess I would start by created a pair<x, x> object, and then register inward and outward conversions for it. Is there a simple recipe for registering these conversions? Cheers, Brett |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Using boost for both embedding and extending.: 00219, Brett Calcott |
|---|---|
| Next by Date: | Re: Re: instantiating python objects within C++: 00219, thor . arne . johansen |
| Previous by Thread: | Using boost for both embedding and extending.i: 00219, Kirsebom Nikolai |
| Next by Thread: | Re: registering simple conversions from/to python: 00219, Ralf W. Grosse-Kunstleve |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |