aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Brody Critchlow <[email protected]>2023-01-26 11:05:48 -0700
committerGravatar GitHub <[email protected]>2023-01-26 11:05:48 -0700
commitae70912045d5c817acecdf0025dd00f6cbb846a6 (patch)
treee5a1f5900906e1f6ba8ee91dd7e066ea7ebfd149
parentAdd missing code blocks (diff)
Clarify empty and why it errors.
-rw-r--r--bot/resources/tags/in-place.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/bot/resources/tags/in-place.md b/bot/resources/tags/in-place.md
index f1d3090fd..8c5df89c9 100644
--- a/bot/resources/tags/in-place.md
+++ b/bot/resources/tags/in-place.md
@@ -9,7 +9,7 @@ For example, the following code will result in an error:
```py
a_list = [3, 1, 2]
a_new_list = a_list.sort() # This will be None
-print(a_new_list[1]) # This will error because it is empty
+print(a_new_list[1]) # This will error because it is NoneType and not a list
```
On the other hand, using the function `sorted(...)` will return a new sorted list, leaving the original list unchanged. This means that if you expect the original list to be sorted, you will be disappointed with the result. For example, the following code will print 3 instead of 1: