We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a215b5d commit d39b4f2Copy full SHA for d39b4f2
2 files changed
news/2 Fixes/5387.md
@@ -0,0 +1 @@
1
+Value 'None' sometimes shows up in the Count column of the variable explorer
pythonFiles/datascience/getJupyterVariableValue.py
@@ -10,7 +10,12 @@
10
# Find shape and count if available
11
if (hasattr(_VSCODE_evalResult, 'shape')):
12
try:
13
- _VSCODE_targetVariable['shape'] = str(_VSCODE_evalResult.shape)
+ # Get a bit more restrictive with exactly what we want to count as a shape, since anything can define it
14
+ if isinstance(_VSCODE_evalResult.shape, tuple):
15
+ _VSCODE_shapeStr = str(_VSCODE_evalResult.shape)
16
+ if len(_VSCODE_shapeStr) >= 3 and _VSCODE_shapeStr[0] == '(' and _VSCODE_shapeStr[-1] == ')' and ',' in _VSCODE_shapeStr:
17
+ _VSCODE_targetVariable['shape'] = _VSCODE_shapeStr
18
+ del _VSCODE_shapeStr
19
except TypeError:
20
pass
21
0 commit comments