diff --git a/panda/src/express/pointerToArray.I b/panda/src/express/pointerToArray.I index 3e035f458b..c9f19c2d18 100644 --- a/panda/src/express/pointerToArray.I +++ b/panda/src/express/pointerToArray.I @@ -831,6 +831,23 @@ ConstPointerToArray(const ConstPointerToArray ©) : { } +#ifdef HAVE_PYTHON +//////////////////////////////////////////////////////////////////// +// Function: ConstPointerToArray::Constructor +// Access: Public +// Description: This special constructor accepts a Python list of +// elements, or a Python string (or a bytes object, +// in Python 3). +//////////////////////////////////////////////////////////////////// +template +INLINE ConstPointerToArray:: +ConstPointerToArray(PyObject *self, PyObject *sequence) : + PointerToArrayBase(PointerToArray(self, sequence)), + _type_handle(get_type_handle(Element)) +{ +} +#endif // HAVE_PYTHON + //////////////////////////////////////////////////////////////////// // Function: ConstPointerToArray::begin // Access: Public diff --git a/panda/src/express/pointerToArray.h b/panda/src/express/pointerToArray.h index b0517803cb..fb7c89e77d 100644 --- a/panda/src/express/pointerToArray.h +++ b/panda/src/express/pointerToArray.h @@ -267,6 +267,10 @@ PUBLISHED: INLINE ConstPointerToArray(const PointerToArray ©); INLINE ConstPointerToArray(const ConstPointerToArray ©); +#ifdef HAVE_PYTHON + INLINE ConstPointerToArray(PyObject *self, PyObject *sequence); +#endif + typedef TYPENAME pvector::size_type size_type; INLINE size_type size() const; INLINE const Element &get_element(size_type n) const; @@ -298,6 +302,10 @@ PUBLISHED: INLINE ConstPointerToArray(const PointerToArray ©); INLINE ConstPointerToArray(const ConstPointerToArray ©); +#ifdef HAVE_PYTHON + INLINE ConstPointerToArray(PyObject *self, PyObject *sequence); +#endif + // Duplicating the interface of vector. INLINE iterator begin() const;