summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorSeth Morton <seth.m.morton@gmail.com>2020-04-25 11:17:23 -0700
committerSeth Morton <seth.m.morton@gmail.com>2020-04-25 11:22:31 -0700
commit54120b4bfeb221f464678f78cb2a3b13b701f717 (patch)
treeb64ce727d67fdd19c7b39c987a796dd7d04a5470 /docs
parent6938b31d45f28354c9eaf286e44f0b11cbde0951 (diff)
downloadnatsort-54120b4bfeb221f464678f78cb2a3b13b701f717.tar.gz
Dix missing example blocks in how-it-works
Diffstat (limited to 'docs')
-rw-r--r--docs/howitworks.rst6
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/howitworks.rst b/docs/howitworks.rst
index 6373f3c..c2aec9a 100644
--- a/docs/howitworks.rst
+++ b/docs/howitworks.rst
@@ -36,7 +36,7 @@ If I want to compare '2 ft 7 in' to '2 ft 11 in', I might do the following
We as humans know that the above should be true, but why does Python think it
is false? Here is how it is performing the comparison:
-.. code-block::
+::
'2' <=> '2' ==> equal, so keep going
' ' <=> ' ' ==> equal, so keep going
@@ -57,14 +57,14 @@ right thing." Luckily, it handles sorting lists of strings right
out-of-the-box, so the only hard part is actually making this string-to-list
transformation and then Python will handle the rest.
-.. code-block::
+::
'2 ft 7 in' ==> (2, ' ft ', 7, ' in')
'2 ft 11 in' ==> (2, ' ft ', 11, ' in')
When Python compares the two, it roughly follows the below logic:
-.. code-block::
+k::
2 <=> 2 ==> equal, so keep going
' ft ' <=> ' ft ' ==> a string is a special type of sequence - evaluate each character individually