Is there anybody has idea about access the set from python?
It's strange that boost::python don't support boost::python::set. Set is a very usable structure, so is there any idea about it? How to convert a python::set to a std::set or any other hash-able structure? Btw, how about boost::python::dict's performance? Does it implemented by hash-table? Thanks for any reply.
On 18.01.2017 23:04, 奇真亦假 wrote:
It's strange that boost::python don't support boost::python::set.
Indeed, a wrapper type for that is missing. Feel free to submit a patch.
Set is a very usable structure, so is there any idea about it? How to convert a python::set to a std::set or any other hash-able structure?
Converting python sets to C++ should be done by custom converters, as I doubt there is a single way to do it that would meet everyone's requirement.
Btw, how about boost::python::dict's performance? Does it implemented by hash-table?
All boost::python object types are thin wrappers around their Python counterparts, i.e. a boost::python::dict simply wraps a Python dict. See http://boostorg.github.io/python/doc/html/tutorial/tutorial/object.html#tuto... Stefan -- ...ich hab' noch einen Koffer in Berlin...
Thank you very much. You really do me a lot. As I know, it seems that boost::python::set has missed for several years. 2017-01-20 4:23 GMT+08:00 Stefan Seefeld <stefan@seefeld.name>:
On 18.01.2017 23:04, 奇真亦假 wrote:
It's strange that boost::python don't support boost::python::set.
Indeed, a wrapper type for that is missing. Feel free to submit a patch.
Set is a very usable structure, so is there any idea about it? How to convert a python::set to a std::set or any other hash-able structure?
Converting python sets to C++ should be done by custom converters, as I doubt there is a single way to do it that would meet everyone's requirement.
Btw, how about boost::python::dict's performance? Does it implemented by hash-table?
All boost::python object types are thin wrappers around their Python counterparts, i.e. a boost::python::dict simply wraps a Python dict. See http://boostorg.github.io/python/doc/html/tutorial/ tutorial/object.html#tutorial.object.derived_object_types
Stefan
--
...ich hab' noch einen Koffer in Berlin...
_______________________________________________ Cplusplus-sig mailing list Cplusplus-sig@python.org https://mail.python.org/mailman/listinfo/cplusplus-sig
On 19.01.2017 19:48, 奇真亦假 wrote:
Thank you very much. You really do me a lot.
As I know, it seems that boost::python::set has missed for several years.
Right. I'll see whether I can add it for the next release. (Note, though, that this is only a convenience interface. There is nothing you can't already do using the boost::python::object interface. It's just a bit more concise to have a dedicated high-level wrapper type for 'set'.) Stefan -- ...ich hab' noch einen Koffer in Berlin...
participants (2)
-
Stefan Seefeld -
奇真亦假