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

Tons of changes to improve error reporting

Added attributes function.__name__ and function.__signature__ and dir(function) feature


[SVN r8311]
This commit is contained in:
Ullrich Köthe
2000-11-23 22:48:51 +00:00
parent 4d7b6fe92a
commit ec4bc0382f
18 changed files with 1153 additions and 1134 deletions

View File

@@ -130,6 +130,8 @@ private: // override function hook
PyObject* do_call(PyObject* args, PyObject* keywords) const;
private:
virtual instance_holder_base* create_holder(extension_instance* self, PyObject* tail_args, PyObject* keywords) const = 0;
string description_as_string() const;
string argument_types_as_string(tuple args) const;
};
""" + gen_functions("""
@@ -145,8 +147,20 @@ struct init%x : init
python::detail::reference_parameter<A%n>(from_python(a%n, type<A%n>()))%)
);
}
const char* description() const
{ return typeid(void (*)(T&%(, A%n%%))).name(); }
PyObject* description() const
{
return function_signature(python::type<T>()%(,
python::type<A%n>()%));
}
string function_name() const
{
static const bool is_plain = BOOST_PYTHON_IS_PLAIN(T);
string result(python_type_name_selector<is_plain>::get(python::type<T>()));
result += ".__init__";
return result;
}
};""", args) + """
}} // namespace python::detail