1 [section boost/python/dict.hpp]
3 Exposes a [link concepts.objectwrapper.typewrapper_concept_requirements TypeWrapper] for the Python [@http://www.python.org/dev/doc/devel/lib/typesmapping.html `dict`] type.
6 Exposes the [@http://www.python.org/dev/doc/devel/lib/typesmapping.html mapping protocol] of Python's built-in `dict` type. The semantics of the constructors and member functions defined below can be fully understood by reading the [link concepts.objectwrapper.typewrapper_concept_requirements TypeWrapper] concept definition. Since `dict` is publicly derived from [link object_wrappers.boost_python_object_hpp.class_object `object`], the public `object` interface applies to `dict` instances as well.
8 namespace boost { namespace python
10 class dict : public object
21 template <class T1, class T2>
25 object setdefault(T const &k);
27 template <class T1, class T2>
28 object setdefault(T1 const & k, T2 const & d);
30 void update(object_cref E);
33 void update(T const & E);
38 object get(object_cref k) const;
41 object get(T const & k) const;
43 object get(object_cref k, object_cref d) const;
44 object get(T1 const & k, T2 const & d) const;
46 bool has_key(object_cref k) const;
49 bool has_key(T const & k) const;
52 object iteritems() const;
53 object iterkeys() const;
54 object itervalues() const;
62 using namespace boost::python;
63 dict swap_object_dict(object target, dict d)
65 dict result = extract<dict>(target.attr("__dict__"));
66 target.attr("__dict__") = d;