Python.Runtime.ClassBase.tp_iter C# (CSharp) Метод

tp_iter() приватный Метод

private tp_iter ( IntPtr ob ) : IntPtr
ob System.IntPtr
Результат System.IntPtr
	public static IntPtr tp_iter(IntPtr ob) {
	    CLRObject co = GetManagedObject(ob) as CLRObject;
	    if (co == null) {
		return Exceptions.RaiseTypeError("invalid object");
	    }

	    IEnumerable e = co.inst as IEnumerable;
	    IEnumerator o;

	    if (e != null) {
		o = e.GetEnumerator();
	    }
	    else {
		o = co.inst as IEnumerator;
		if (o == null) {
		    string message = "iteration over non-sequence";
		    return Exceptions.RaiseTypeError(message);
		}
	    }

	    return new Iterator(o).pyHandle;
	}