mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
restore implicit coercion of Python objects into CPTA
This commit is contained in:
parent
e36dee223a
commit
a27908a7e8
@ -831,6 +831,23 @@ ConstPointerToArray(const ConstPointerToArray<Element> ©) :
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#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<class Element>
|
||||||
|
INLINE ConstPointerToArray<Element>::
|
||||||
|
ConstPointerToArray(PyObject *self, PyObject *sequence) :
|
||||||
|
PointerToArrayBase<Element>(PointerToArray<Element>(self, sequence)),
|
||||||
|
_type_handle(get_type_handle(Element))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#endif // HAVE_PYTHON
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: ConstPointerToArray::begin
|
// Function: ConstPointerToArray::begin
|
||||||
// Access: Public
|
// Access: Public
|
||||||
|
@ -267,6 +267,10 @@ PUBLISHED:
|
|||||||
INLINE ConstPointerToArray(const PointerToArray<Element> ©);
|
INLINE ConstPointerToArray(const PointerToArray<Element> ©);
|
||||||
INLINE ConstPointerToArray(const ConstPointerToArray<Element> ©);
|
INLINE ConstPointerToArray(const ConstPointerToArray<Element> ©);
|
||||||
|
|
||||||
|
#ifdef HAVE_PYTHON
|
||||||
|
INLINE ConstPointerToArray(PyObject *self, PyObject *sequence);
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef TYPENAME pvector<Element>::size_type size_type;
|
typedef TYPENAME pvector<Element>::size_type size_type;
|
||||||
INLINE size_type size() const;
|
INLINE size_type size() const;
|
||||||
INLINE const Element &get_element(size_type n) const;
|
INLINE const Element &get_element(size_type n) const;
|
||||||
@ -298,6 +302,10 @@ PUBLISHED:
|
|||||||
INLINE ConstPointerToArray(const PointerToArray<Element> ©);
|
INLINE ConstPointerToArray(const PointerToArray<Element> ©);
|
||||||
INLINE ConstPointerToArray(const ConstPointerToArray<Element> ©);
|
INLINE ConstPointerToArray(const ConstPointerToArray<Element> ©);
|
||||||
|
|
||||||
|
#ifdef HAVE_PYTHON
|
||||||
|
INLINE ConstPointerToArray(PyObject *self, PyObject *sequence);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Duplicating the interface of vector.
|
// Duplicating the interface of vector.
|
||||||
|
|
||||||
INLINE iterator begin() const;
|
INLINE iterator begin() const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user