Conversation

🤯🤯🤯🤯 Is there an option to save the code in a repl? Can't wait for further integration between these two tools -> code generation via #chatGPT then execution directly in Repl.it
Quote Tweet
This is crazy 🤯 You can open a Python REPL... define a function call the function delete the function then try call it again – and it raises an error!
Show this thread
>>> {Open a Python REPL}
python

>>> print("Hello world")

python
Hello world
>>> def f(x): return x ** 2
python
def f(x): return x ** 2

>>> f(10)
python
def f(x): return x ** 2
f(10)
100
>>> del f
python
del f
>>> f
python
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'f' is not defined
>>> def f(x): return x ** 2
>>> inspect.signature(f)
python
def f(x): return x ** 2
inspect.signature(f)
<Signature (x)>