Skip to content

Commit 6417f8b

Browse files
committed
doc: warn about reassigning _ in REPL
When users assign a value to `_` in REPL, it is prone to unexpected results or messing up with REPL's internals. For example, #3704. This patch issues a warning about the same.
1 parent 2c33819 commit 6417f8b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

doc/api/repl.markdown

+3
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ The special variable `_` (underscore) contains the result of the last expression
219219
> _ += 1
220220
4
221221

222+
*NOTE*: Explicitly assigning a value to `_` in the REPL can produce unexpected
223+
results.
224+
222225
The REPL provides access to any variables in the global scope. You can expose
223226
a variable to the REPL explicitly by assigning it to the `context` object
224227
associated with each `REPLServer`. For example:

0 commit comments

Comments
 (0)