[C++-sig] Re: Returning reference to member variable that's a basic type

David Abrahams dave at boost-consulting.com
Sat Oct 4 02:35:12 CEST 2003


Joel Gerard <llywelyn.geo at yahoo.com> writes:

> I hope this doesn't get me the dumb question of the day award but...
>
> How do you return a pointer/reference to a member variable(a basic type) and modify it from
> python?

You don't.  Basic types get mapped to Python ints, longs, and
strings, all of which are immutable.  YOu can't modify them.

Decide what interface you'd like to see for this code in Python, code
up a pure-Python mock-up which does what you want, and we can discuss
how to achieve it with BPL.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com





More information about the Cplusplus-sig mailing list