Boost logo

Boost-Commit :

From: nickm_at_[hidden]
Date: 2007-11-07 11:06:56


Author: nikiml
Date: 2007-11-07 11:06:55 EST (Wed, 07 Nov 2007)
New Revision: 40889
URL: http://svn.boost.org/trac/boost/changeset/40889

Log:
added forgotten array_object_manager_traits::get_pytype
Text files modified:
   trunk/boost/python/numeric.hpp | 1 +
   trunk/libs/python/src/numeric.cpp | 6 ++++++
   trunk/libs/python/test/numpy.cpp | 2 +-
   3 files changed, 8 insertions(+), 1 deletions(-)

Modified: trunk/boost/python/numeric.hpp
==============================================================================
--- trunk/boost/python/numeric.hpp (original)
+++ trunk/boost/python/numeric.hpp 2007-11-07 11:06:55 EST (Wed, 07 Nov 2007)
@@ -92,6 +92,7 @@
   {
       static bool check(PyObject* obj);
       static detail::new_non_null_reference adopt(PyObject* obj);
+ static PyTypeObject const* get_pytype() ;
   };
 } // namespace aux
 

Modified: trunk/libs/python/src/numeric.cpp
==============================================================================
--- trunk/libs/python/src/numeric.cpp (original)
+++ trunk/libs/python/src/numeric.cpp 2007-11-07 11:06:55 EST (Wed, 07 Nov 2007)
@@ -114,6 +114,12 @@
           pytype_check(downcast<PyTypeObject>(array_type.get()), obj));
   }
 
+ PyTypeObject const* array_object_manager_traits::get_pytype()
+ {
+ load(false);
+ if(!array_type) return 0;
+ return handle<PyTypeObject>(array_type).get();
+ }
 
 # define BOOST_PYTHON_AS_OBJECT(z, n, _) object(x##n)
 # define BOOST_PP_LOCAL_MACRO(n) \

Modified: trunk/libs/python/test/numpy.cpp
==============================================================================
--- trunk/libs/python/test/numpy.cpp (original)
+++ trunk/libs/python/test/numpy.cpp 2007-11-07 11:06:55 EST (Wed, 07 Nov 2007)
@@ -16,7 +16,7 @@
 #endif
 
 // See if we can invoke array() from C++
-object new_array()
+numeric::array new_array()
 {
     return numeric::array(
         make_tuple(


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk