Changes from ipy2.7
@@ -202,9 +202,16 @@ namespace IronPython.Modules {
public void extend(object iterable) {
array pa = iterable as array;
- if (pa != null && typecode != pa.typecode) {
+ if (pa != null) {
+ if (typecode != pa.typecode) {
throw PythonOps.TypeError("cannot extend with different typecode");
}
+ int l = pa._data.Length;
+ for (int i = 0; i < l; i++) {
+ _data.Append(pa._data.GetData(i));
+ }
+ return;
+ }
string str = iterable as string;
if (str != null && _typeCode != 'u') {
@@ -351,10 +358,6 @@ namespace IronPython.Modules {
return res;
}
- public void read(PythonFile f, int n) {
- fromfile(f, n);
- }
-
public void remove(object value) {
if (value == null) throw PythonOps.ValueError("got None, expected value");
@@ -560,7 +563,7 @@ namespace IronPython.Modules {
DynamicHelpers.GetPythonType(this),
PythonOps.MakeTuple(
typecode,
- ToByteArray().MakeString()
+ tolist()
),
null
);
@@ -570,9 +573,9 @@ namespace IronPython.Modules {
return new array(typecode, this);
}
- public array __deepcopy__() {
+ public array __deepcopy__(array arg) {
// we only have simple data so this is the same as a copy
- return __copy__();
+ return arg.__copy__();
}
public PythonTuple __reduce_ex__(int version) {
@@ -617,10 +620,6 @@ namespace IronPython.Modules {
return new string(((ArrayData<char>)_data).Data, 0, _data.Length);
}
- public void write(PythonFile f) {
- tofile(f);
- }
-
public string/*!*/ typecode {
get { return ScriptingRuntimeHelpers.CharToString(_typeCode); }
}
