2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-23 17:52:17 +00:00

obtain correct class name via cl.attr("__name__")

[SVN r23359]
This commit is contained in:
Ralf W. Grosse-Kunstleve
2004-07-06 04:36:50 +00:00
parent 858e5e9720
commit 112c999818
2 changed files with 6 additions and 1 deletions

View File

@@ -73,7 +73,9 @@ namespace boost { namespace python {
{
// Wrap the map's element (value_type)
std::string elem_name = "map_indexing_suite_";
elem_name += cl.ptr()->ob_type->tp_name; // the class name
object class_name(cl.attr("__name__"));
extract<std::string> class_name_extractor(class_name);
elem_name += class_name_extractor();
elem_name += "_entry";
typedef typename mpl::if_<

View File

@@ -5,6 +5,9 @@
#####################################################################
>>> from map_indexing_suite_ext import *
>>> assert "map_indexing_suite_IntMap_entry" in dir()
>>> assert "map_indexing_suite_TestMap_entry" in dir()
>>> assert "map_indexing_suite_XMap_entry" in dir()
>>> x = X('hi')
>>> x
hi