| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 4c53587 commit eb825df
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -92,16 +92,6 @@ internal static IntPtr ToPython(Object value, Type type) { | |||
| 92 | 92 | return result; | |
| 93 | 93 | } | |
| 94 | 94 | ||
| 95 | - if (value is IEnumerable) | ||
| 96 | - { | ||
| 97 | - var resultlist = new PyList(); | ||
| 98 | - foreach (object o in (IEnumerable)value) | ||
| 99 | - { | ||
| 100 | - resultlist.Append(new PyObject(ToPython(o, o.GetType()))); | ||
| 101 | - } | ||
| 102 | - return resultlist.Handle; | ||
| 103 | - } | ||
| 104 | - | ||
| 105 | 95 | // it the type is a python subclass of a managed type then return the | |
| 106 | 96 | // underying python object rather than construct a new wrapper object. | |
| 107 | 97 | IPythonDerivedType pyderived = value as IPythonDerivedType; | |
@@ -184,19 +174,17 @@ internal static IntPtr ToPython(Object value, Type type) { | |||
| 184 | 174 | return Runtime.PyLong_FromUnsignedLongLong((ulong)value); | |
| 185 | 175 | ||
| 186 | 176 | default: | |
| 187 | - if (value is IEnumerable) | ||
| 188 | - { | ||
| 177 | + if (value is IEnumerable) { | ||
| 189 | 178 | var resultlist = new PyList(); | |
| 190 | - foreach (object o in (IEnumerable)value) | ||
| 191 | - { | ||
| 179 | + foreach (object o in (IEnumerable)value) { | ||
| 192 | 180 | resultlist.Append(new PyObject(ToPython(o, o.GetType()))); | |
| 193 | 181 | } | |
| 194 | 182 | return resultlist.Handle; | |
| 195 | 183 | } | |
| 184 | + | ||
| 196 | 185 | result = CLRObject.GetInstHandle(value, type); | |
| 197 | 186 | return result; | |
| 198 | 187 | } | |
| 199 | - | ||
| 200 | 188 | } | |
| 201 | 189 | ||
| 202 | 190 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments