summaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2023-04-06 13:08:47 +0100
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2023-04-26 18:18:15 +0100
commit08aee96cbd1de0c842b29776be8c24e9f742ef2d (patch)
tree00602cf6b84830b761a3ff387a6208512d5e3203 /Lib
parentd5291a77e18dbc5342803f1d80bc55c6333f1271 (diff)
downloadswig-08aee96cbd1de0c842b29776be8c24e9f742ef2d.tar.gz
Remove assign method uses by the removed Python Sequence Protocol
Diffstat (limited to 'Lib')
-rw-r--r--Lib/python/pycontainer.swg11
-rw-r--r--Lib/python/pyname_compat.i2
-rw-r--r--Lib/python/std_array.i10
-rw-r--r--Lib/python/std_map.i10
-rw-r--r--Lib/python/std_multimap.i10
-rw-r--r--Lib/python/std_multiset.i11
-rw-r--r--Lib/python/std_set.i11
-rw-r--r--Lib/python/std_unordered_map.i10
-rw-r--r--Lib/python/std_unordered_multimap.i10
-rw-r--r--Lib/python/std_unordered_multiset.i11
-rw-r--r--Lib/python/std_unordered_set.i11
11 files changed, 0 insertions, 107 deletions
diff --git a/Lib/python/pycontainer.swg b/Lib/python/pycontainer.swg
index b77a37876..2c0466c21 100644
--- a/Lib/python/pycontainer.swg
+++ b/Lib/python/pycontainer.swg
@@ -775,17 +775,6 @@ namespace swig {
fragment="SwigPySequence_Cont")
{
namespace swig {
- template <class SwigPySeq, class Seq>
- inline void
- assign(const SwigPySeq& swigpyseq, Seq* seq) {
- // seq->assign(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented
- typedef typename SwigPySeq::value_type value_type;
- typename SwigPySeq::const_iterator it = swigpyseq.begin();
- for (;it != swigpyseq.end(); ++it) {
- seq->insert(seq->end(),(value_type)(*it));
- }
- }
-
template <class Seq, class T = typename Seq::value_type >
struct IteratorProtocol {
static void assign(PyObject *obj, Seq *seq) {
diff --git a/Lib/python/pyname_compat.i b/Lib/python/pyname_compat.i
index ca063153b..789b28443 100644
--- a/Lib/python/pyname_compat.i
+++ b/Lib/python/pyname_compat.i
@@ -37,7 +37,6 @@
#define PyObject_ptr SwigPtr_PyObject
#define PyObject_var SwigVar_PyObject
#define PyOper SwigPyOper
-#define PySeq SwigPySeq
#define PySwigClientData SwigPyClientData
#define PySwigClientData_Del SwigPyClientData_Del
#define PySwigClientData_New SwigPyClientData_New
@@ -74,7 +73,6 @@
#define PySwigPacked_repr SwigPyPacked_repr
#define PySwigPacked_str SwigPyPacked_str
#define PySwigPacked_type SwigPyPacked_type
-#define pyseq swigpyseq
#define pyswigobject_type swigpyobject_type
#define pyswigpacked_type swigpypacked_type
%}
diff --git a/Lib/python/std_array.i b/Lib/python/std_array.i
index d41d1f15e..561f00fc7 100644
--- a/Lib/python/std_array.i
+++ b/Lib/python/std_array.i
@@ -19,16 +19,6 @@
}
};
- template <class SwigPySeq, class T, size_t N>
- inline void
- assign(const SwigPySeq& swigpyseq, std::array<T, N>* seq) {
- if (swigpyseq.size() < seq->size())
- throw std::invalid_argument("std::array cannot be expanded in size");
- else if (swigpyseq.size() > seq->size())
- throw std::invalid_argument("std::array cannot be reduced in size");
- std::copy(swigpyseq.begin(), swigpyseq.end(), seq->begin());
- }
-
template <class T, size_t N>
struct IteratorProtocol<std::array<T, N>, T> {
diff --git a/Lib/python/std_map.i b/Lib/python/std_map.i
index e0b7d69dc..ef6eb7f20 100644
--- a/Lib/python/std_map.i
+++ b/Lib/python/std_map.i
@@ -77,16 +77,6 @@
%fragment("StdMapTraits","header",fragment="StdMapCommonTraits")
{
namespace swig {
- template <class SwigPySeq, class K, class T, class Compare, class Alloc >
- inline void
- assign(const SwigPySeq& swigpyseq, std::map<K,T,Compare,Alloc > *map) {
- typedef typename std::map<K,T,Compare,Alloc >::value_type value_type;
- typename SwigPySeq::const_iterator it = swigpyseq.begin();
- for (;it != swigpyseq.end(); ++it) {
- map->insert(value_type(it->first, it->second));
- }
- }
-
template <class K, class T, class Compare, class Alloc>
struct traits_asptr<std::map<K,T,Compare,Alloc > > {
typedef std::map<K,T,Compare,Alloc > map_type;
diff --git a/Lib/python/std_multimap.i b/Lib/python/std_multimap.i
index bbffb6bcd..75b4d7fcf 100644
--- a/Lib/python/std_multimap.i
+++ b/Lib/python/std_multimap.i
@@ -6,16 +6,6 @@
%fragment("StdMultimapTraits","header",fragment="StdMapCommonTraits")
{
namespace swig {
- template <class SwigPySeq, class K, class T >
- inline void
- assign(const SwigPySeq& swigpyseq, std::multimap<K,T > *multimap) {
- typedef typename std::multimap<K,T>::value_type value_type;
- typename SwigPySeq::const_iterator it = swigpyseq.begin();
- for (;it != swigpyseq.end(); ++it) {
- multimap->insert(value_type(it->first, it->second));
- }
- }
-
template <class K, class T>
struct traits_asptr<std::multimap<K,T> > {
typedef std::multimap<K,T> multimap_type;
diff --git a/Lib/python/std_multiset.i b/Lib/python/std_multiset.i
index ac430334c..b79f64e5a 100644
--- a/Lib/python/std_multiset.i
+++ b/Lib/python/std_multiset.i
@@ -7,17 +7,6 @@
%fragment("StdMultisetTraits","header",fragment="StdSequenceTraits")
%{
namespace swig {
- template <class SwigPySeq, class T>
- inline void
- assign(const SwigPySeq& swigpyseq, std::multiset<T>* seq) {
- // seq->insert(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented
- typedef typename SwigPySeq::value_type value_type;
- typename SwigPySeq::const_iterator it = swigpyseq.begin();
- for (;it != swigpyseq.end(); ++it) {
- seq->insert(seq->end(),(value_type)(*it));
- }
- }
-
template <class T>
struct traits_asptr<std::multiset<T> > {
static int asptr(PyObject *obj, std::multiset<T> **m) {
diff --git a/Lib/python/std_set.i b/Lib/python/std_set.i
index 0ef011998..3f80daff6 100644
--- a/Lib/python/std_set.i
+++ b/Lib/python/std_set.i
@@ -5,17 +5,6 @@
%fragment("StdSetTraits","header",fragment="StdSequenceTraits")
%{
namespace swig {
- template <class SwigPySeq, class T>
- inline void
- assign(const SwigPySeq& swigpyseq, std::set<T>* seq) {
- // seq->insert(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented
- typedef typename SwigPySeq::value_type value_type;
- typename SwigPySeq::const_iterator it = swigpyseq.begin();
- for (;it != swigpyseq.end(); ++it) {
- seq->insert(seq->end(),(value_type)(*it));
- }
- }
-
template <class T>
struct traits_asptr<std::set<T> > {
static int asptr(PyObject *obj, std::set<T> **s) {
diff --git a/Lib/python/std_unordered_map.i b/Lib/python/std_unordered_map.i
index 784be4c8f..200ec2c5d 100644
--- a/Lib/python/std_unordered_map.i
+++ b/Lib/python/std_unordered_map.i
@@ -56,16 +56,6 @@
%fragment("StdUnorderedMapTraits","header",fragment="StdMapCommonTraits",fragment="StdUnorderedMapForwardIteratorTraits")
{
namespace swig {
- template <class SwigPySeq, class K, class T, class Hash, class Compare, class Alloc>
- inline void
- assign(const SwigPySeq& swigpyseq, std::unordered_map<K,T,Hash,Compare,Alloc> *unordered_map) {
- typedef typename std::unordered_map<K,T,Hash,Compare,Alloc>::value_type value_type;
- typename SwigPySeq::const_iterator it = swigpyseq.begin();
- for (;it != swigpyseq.end(); ++it) {
- unordered_map->insert(value_type(it->first, it->second));
- }
- }
-
template <class K, class T, class Hash, class Compare, class Alloc>
struct traits_reserve<std::unordered_map<K,T,Hash,Compare,Alloc> > {
static void reserve(std::unordered_map<K,T,Hash,Compare,Alloc> &seq, typename std::unordered_map<K,T,Hash,Compare,Alloc>::size_type n) {
diff --git a/Lib/python/std_unordered_multimap.i b/Lib/python/std_unordered_multimap.i
index bc095ea48..816ec0933 100644
--- a/Lib/python/std_unordered_multimap.i
+++ b/Lib/python/std_unordered_multimap.i
@@ -6,16 +6,6 @@
%fragment("StdUnorderedMultimapTraits","header",fragment="StdMapCommonTraits",fragment="StdUnorderedMapForwardIteratorTraits")
{
namespace swig {
- template <class SwigPySeq, class K, class T, class Hash, class Compare, class Alloc>
- inline void
- assign(const SwigPySeq& swigpyseq, std::unordered_multimap<K,T,Hash,Compare,Alloc> *unordered_multimap) {
- typedef typename std::unordered_multimap<K,T,Hash,Compare,Alloc>::value_type value_type;
- typename SwigPySeq::const_iterator it = swigpyseq.begin();
- for (;it != swigpyseq.end(); ++it) {
- unordered_multimap->insert(value_type(it->first, it->second));
- }
- }
-
template <class K, class T, class Hash, class Compare, class Alloc>
struct traits_reserve<std::unordered_multimap<K,T,Hash,Compare,Alloc> > {
static void reserve(std::unordered_multimap<K,T,Hash,Compare,Alloc> &seq, typename std::unordered_multimap<K,T,Hash,Compare,Alloc>::size_type n) {
diff --git a/Lib/python/std_unordered_multiset.i b/Lib/python/std_unordered_multiset.i
index b0f3f096b..0542247b2 100644
--- a/Lib/python/std_unordered_multiset.i
+++ b/Lib/python/std_unordered_multiset.i
@@ -7,17 +7,6 @@
%fragment("StdUnorderedMultisetTraits","header",fragment="StdSequenceTraits")
%{
namespace swig {
- template <class SwigPySeq, class Key, class Hash, class Compare, class Alloc>
- inline void
- assign(const SwigPySeq& swigpyseq, std::unordered_multiset<Key,Hash,Compare,Alloc>* seq) {
- // seq->insert(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented
- typedef typename SwigPySeq::value_type value_type;
- typename SwigPySeq::const_iterator it = swigpyseq.begin();
- for (;it != swigpyseq.end(); ++it) {
- seq->insert(seq->end(),(value_type)(*it));
- }
- }
-
template <class Key, class Hash, class Compare, class Alloc>
struct traits_reserve<std::unordered_multiset<Key,Hash,Compare,Alloc> > {
static void reserve(std::unordered_multiset<Key,Hash,Compare,Alloc> &seq, typename std::unordered_multiset<Key,Hash,Compare,Alloc>::size_type n) {
diff --git a/Lib/python/std_unordered_set.i b/Lib/python/std_unordered_set.i
index 79fca6c2f..fd866b14a 100644
--- a/Lib/python/std_unordered_set.i
+++ b/Lib/python/std_unordered_set.i
@@ -5,17 +5,6 @@
%fragment("StdUnorderedSetTraits","header",fragment="StdSequenceTraits")
%{
namespace swig {
- template <class SwigPySeq, class Key, class Hash, class Compare, class Alloc>
- inline void
- assign(const SwigPySeq& swigpyseq, std::unordered_set<Key,Hash,Compare,Alloc>* seq) {
- // seq->insert(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented
- typedef typename SwigPySeq::value_type value_type;
- typename SwigPySeq::const_iterator it = swigpyseq.begin();
- for (;it != swigpyseq.end(); ++it) {
- seq->insert(seq->end(),(value_type)(*it));
- }
- }
-
template <class Key, class Hash, class Compare, class Alloc>
struct traits_reserve<std::unordered_set<Key,Hash,Compare,Alloc> > {
static void reserve(std::unordered_set<Key,Hash,Compare,Alloc> &seq, typename std::unordered_set<Key,Hash,Compare,Alloc>::size_type n) {