mirror of
https://github.com/boostorg/python.git
synced 2026-01-21 17:12:22 +00:00
Add from/to_python for signed char and unsigned char
[SVN r8130]
This commit is contained in:
20
py.cpp
20
py.cpp
@@ -170,6 +170,26 @@ unsigned short from_python(PyObject* p, py::Type<unsigned short> type)
|
||||
return integer_from_python(p, type);
|
||||
}
|
||||
|
||||
PyObject* to_python(unsigned char i)
|
||||
{
|
||||
return integer_to_python(i);
|
||||
}
|
||||
|
||||
unsigned char from_python(PyObject* p, py::Type<unsigned char> type)
|
||||
{
|
||||
return integer_from_python(p, type);
|
||||
}
|
||||
|
||||
PyObject* to_python(signed char i)
|
||||
{
|
||||
return integer_to_python(i);
|
||||
}
|
||||
|
||||
signed char from_python(PyObject* p, py::Type<signed char> type)
|
||||
{
|
||||
return integer_from_python(p, type);
|
||||
}
|
||||
|
||||
PyObject* to_python(unsigned long x)
|
||||
{
|
||||
return integer_to_python(x);
|
||||
|
||||
18
py.h
18
py.h
@@ -73,6 +73,14 @@ PyObject* to_python(unsigned short);
|
||||
unsigned short from_python(PyObject*, py::Type<unsigned short>);
|
||||
unsigned short from_python(PyObject*, py::Type<const unsigned short&>);
|
||||
|
||||
PyObject* to_python(signed char);
|
||||
signed char from_python(PyObject*, py::Type<signed char>);
|
||||
signed char from_python(PyObject*, py::Type<const signed char&>);
|
||||
|
||||
PyObject* to_python(unsigned char);
|
||||
unsigned char from_python(PyObject*, py::Type<unsigned char>);
|
||||
unsigned char from_python(PyObject*, py::Type<const unsigned char&>);
|
||||
|
||||
PyObject* to_python(float);
|
||||
float from_python(PyObject*, py::Type<float>);
|
||||
float from_python(PyObject*, py::Type<const float&>);
|
||||
@@ -269,6 +277,16 @@ inline unsigned short from_python(PyObject* p, py::Type<const unsigned short&>)
|
||||
return from_python(p, py::Type<unsigned short>());
|
||||
}
|
||||
|
||||
inline signed char from_python(PyObject* p, py::Type<const signed char&>)
|
||||
{
|
||||
return from_python(p, py::Type<signed char>());
|
||||
}
|
||||
|
||||
inline unsigned char from_python(PyObject* p, py::Type<const unsigned char&>)
|
||||
{
|
||||
return from_python(p, py::Type<unsigned char>());
|
||||
}
|
||||
|
||||
inline unsigned long from_python(PyObject* p, py::Type<const unsigned long&>)
|
||||
{
|
||||
return from_python(p, py::Type<unsigned long>());
|
||||
|
||||
Reference in New Issue
Block a user