class SimpleExample:
def __init__(self):
self.value = 42
def nested_method(self):
if self.value > 0:
print("Positive")
return True
return False
# Test instance
example = SimpleExample()
example.nested_method()
Version: 0.48.8 (Universal)
VSCode Version: 1.96.2
Commit: 7801■■■6824585b7f2721900066bc87c4a09b740
Date: 2025-04-07T19:55:07.781Z
Electron: 34.3.4
Chromium: 132.0.6834.210
Node.js: 20.18.3
V8: 13.2.152.41-electron.0
OS: Darwin arm64 23.4.0
Selecting the above code with Cmd-A and sending it to the interactive terminal with Shift+Enter does not preserve indentation, resulting in syntax errors, e.g.,
In [1]: class SimpleExample:
...: def __init__(self):
...: self.value = 42
...: def nested_method(self):
...: if self.value > 0:
...: print("Positi
⋮ ve")
Cell In[1], line 4
def nested_method(self):
^
IndentationError: unexpected indent