eric6/DebugClients/Python/DebugVariables.py

branch
maintenance
changeset 8043
0acf98cd089a
parent 7924
8a96736d465e
parent 7988
c4c17121eff8
child 8273
698ae46f40a4
--- a/eric6/DebugClients/Python/DebugVariables.py	Sun Jan 17 13:53:08 2021 +0100
+++ b/eric6/DebugClients/Python/DebugVariables.py	Mon Feb 01 10:38:16 2021 +0100
@@ -74,8 +74,9 @@
         
         @param var variable to be converted
         @type any
-        @return dictionary containing the variable attributes
-        @rtype dict
+        @yield tuple containing the batch start index and a dictionary
+            containing the variable attributes
+        @ytype tuple of (int, dict)
         """
         names = dir(var)
         if not names and hasattr(var, "__members__"):
@@ -138,9 +139,9 @@
         """
         if isinstance(key, str):
             key = repr(key)
-            # Special handling for Python2 unicode strings and bytes object
-            # Raw and f-Strings are always converted to (unicode) str
-            if key[0] in 'ub':
+            # Special handling for bytes object
+            # Raw and f-Strings are always converted to str
+            if key[0] == 'b':
                 key = key[1:]
 
         return key  # __IGNORE_WARNING_M834__
@@ -151,8 +152,9 @@
         
         @param var variable to be converted
         @type any
-        @return dictionary containing the variable attributes
-        @rtype dict
+        @yield tuple containing the batch start index and a dictionary
+            containing the variable attributes
+        @ytype tuple of (int, dict)
         """
         d = {}
         start = count = 0
@@ -216,13 +218,14 @@
         
         @param var variable to be converted
         @type any
-        @return dictionary containing the variable attributes
-        @rtype dict
+        @yield tuple containing the batch start index and a dictionary
+            containing the variable attributes
+        @ytype tuple of (int, dict)
         """
         d = {}
         start = count = 0
         for idx, value in enumerate(var):
-            d[str(idx)] = value
+            d[idx] = value
             count += 1
             if count >= BatchSize:
                 yield start, d
@@ -314,8 +317,9 @@
         
         @param var variable to be converted
         @type any
-        @return dictionary containing the variable attributes
-        @rtype dict
+        @yield tuple containing the batch start index and a dictionary
+            containing the variable attributes
+        @ytype tuple of (int, dict)
         """
         d = {}
         start = count = 0
@@ -404,8 +408,9 @@
         
         @param var variable to be converted
         @type any
-        @return dictionary containing the variable attributes
-        @rtype dict
+        @yield tuple containing the batch start index and a dictionary
+            containing the variable attributes
+        @ytype tuple of (int, dict)
         """
         d = {}
         start = count = 0
@@ -496,8 +501,9 @@
         
         @param var variable to be converted
         @type any
-        @return dictionary containing the variable attributes
-        @rtype dict
+        @yield tuple containing the batch start index and a dictionary
+            containing the variable attributes
+        @ytype tuple of (int, dict)
         """
         d = {}
         start = count = 0
@@ -579,8 +585,9 @@
         
         @param var variable to be converted
         @type any
-        @return dictionary containing the variable attributes
-        @rtype dict
+        @yield tuple containing the batch start index and a dictionary
+            containing the variable attributes
+        @ytype tuple of (int, dict)
         """
         d = {}
         start = count = 0
@@ -652,11 +659,6 @@
         pass    # not available on all Python versions
 
     try:
-        _TypeMap.append((unicode, None))        # __IGNORE_WARNING__
-    except Exception:       # secok
-        pass    # not available on all Python versions
-
-    try:
         import array
         _TypeMap.append((array.array, arrayResolver))
     except ImportError:

eric ide

mercurial