From ee45301b111d740f5165d2a54f4d6da191c4980b Mon Sep 17 00:00:00 2001 From: Ekaterina Tuzova Date: Thu, 2 Apr 2015 12:54:36 +0300 Subject: [PATCH] PY-15295 Numpy: allow passing list arguments for tuple expected types treat all collections as iterable --- .../numpy/codeInsight/NumpyDocStringTypeProvider.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/src/com/jetbrains/numpy/codeInsight/NumpyDocStringTypeProvider.java b/python/src/com/jetbrains/numpy/codeInsight/NumpyDocStringTypeProvider.java index 624a8120d028..2478a2d5a1cb 100644 --- a/python/src/com/jetbrains/numpy/codeInsight/NumpyDocStringTypeProvider.java +++ b/python/src/com/jetbrains/numpy/codeInsight/NumpyDocStringTypeProvider.java @@ -71,7 +71,11 @@ public class NumpyDocStringTypeProvider extends PyTypeProviderBase { // 3 occurrences NUMPY_ALIAS_TO_REAL_TYPE.put("number", "int or long or float or complex"); + //treat all collections as iterable NUMPY_ALIAS_TO_REAL_TYPE.put("sequence", "collections.Iterable"); + NUMPY_ALIAS_TO_REAL_TYPE.put("set", "collections.Iterable"); + NUMPY_ALIAS_TO_REAL_TYPE.put("list", "collections.Iterable"); + NUMPY_ALIAS_TO_REAL_TYPE.put("tuple", "collections.Iterable"); NUMPY_ALIAS_TO_REAL_TYPE.put("ints", "int"); }