5 |
5 |
6 """ |
6 """ |
7 Module implementing classes and functions to dump variable contents. |
7 Module implementing classes and functions to dump variable contents. |
8 """ |
8 """ |
9 |
9 |
10 import sys |
|
11 |
|
12 from DebugConfig import ConfigQtNames, ConfigKnownQtTypes, BatchSize |
10 from DebugConfig import ConfigQtNames, ConfigKnownQtTypes, BatchSize |
13 |
11 |
14 # |
12 # |
15 # This code was inspired by pydevd. |
13 # This code was inspired by pydevd. |
16 # |
14 # |
17 |
|
18 if sys.version_info[0] > 2: |
|
19 basestring = str |
|
20 |
15 |
21 ############################################################ |
16 ############################################################ |
22 ## Classes implementing resolvers for various compund types |
17 ## Classes implementing resolvers for various compund types |
23 ############################################################ |
18 ############################################################ |
24 |
19 |
139 @param key key to be converted |
134 @param key key to be converted |
140 @type any |
135 @type any |
141 @return string representation of the given key |
136 @return string representation of the given key |
142 @rtype str |
137 @rtype str |
143 """ |
138 """ |
144 if isinstance(key, basestring): |
139 if isinstance(key, str): |
145 key = repr(key) |
140 key = repr(key) |
146 # Special handling for Python2 unicode strings and bytes object |
141 # Special handling for Python2 unicode strings and bytes object |
147 # Raw and f-Strings are always converted to (unicode) str |
142 # Raw and f-Strings are always converted to (unicode) str |
148 if key[0] in 'ub': |
143 if key[0] in 'ub': |
149 key = key[1:] |
144 key = key[1:] |