translating "setattr" to C++

Dan Bishop danb_83 at
Fri Mar 19 23:17:36 CET 2004

Eric <eric at> wrote in message news:<87oeqtkruw.fsf at>...
> Slightly off topic, i know, but here goes:
> I'm trying to xlate a module of mine to C++. Only problem is, it makes
> heavy use of "setattr". Anyone know a straightforward way to do
> "setattr" in C++ ?

No, but there's a workaround.

Instead of referring to the fields of an object as, for example,
and, store your object's data in a hash table with "foo" and
"bar" as keys.

More information about the Python-list mailing list