From 2c910351b7a71208562cc03b47b4ebe1a3bd60e1 Mon Sep 17 00:00:00 2001 From: Satwik Date: Fri, 27 Dec 2019 20:04:34 +0530 Subject: [PATCH] Fix relevant typos detected by codespell Closes https://github.com/satwikkansal/wtfpython/issues/161 --- CONTRIBUTING.md | 2 +- README.md | 2 +- irrelevant/notebook_instructions.md | 19 ------------------- irrelevant/obsolete/add_categories | 2 +- irrelevant/wtf.ipynb | 4 ++-- 5 files changed, 5 insertions(+), 24 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e89821d..5085b59 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -29,7 +29,7 @@ Probably unexpected output ```py Setting up examples for clarification (if necessary) ``` - **Outupt:** + **Output:** ```py >>> trigger # some example that makes it easy to unveil the magic # some justified output diff --git a/README.md b/README.md index 7d53527..8ef9d5d 100644 --- a/README.md +++ b/README.md @@ -575,7 +575,7 @@ def one_more_func(): # A gotcha! print("Iteration", i) break except ZeroDivisionError as e: - print("Zero division error ocurred", e) + print("Zero division error occurred", e) ``` **Output:** diff --git a/irrelevant/notebook_instructions.md b/irrelevant/notebook_instructions.md index 891698a..bc267eb 100644 --- a/irrelevant/notebook_instructions.md +++ b/irrelevant/notebook_instructions.md @@ -5,22 +5,3 @@ - Reorder the examples, so that the ones that work are upfront. - Run the `notebook_generator.py`, it will generate a notebook named `wtf.ipynb` - Revert the README.md changes (optional) - - -# Hosted notebook instructions - -This is just an experimental attempt of browsing wtfpython through jupyter notebooks. Some examples are read-only because, -- they either require a version of Python that's not supported in the hosted runtime. -- or they can't be reproduced in the notebook envrinonment. - -The expected outputs are already present in collapsed cells following the code cells. The Google colab provides Python2 (2.7) and Python3 (3.6, default) runtimes. You can switch among these for Python2 specific examples. For examples specific to other minor versions, you can simply refer to collapsed outputs (it's not possible to control the minor version in hosted notebooks as of now). You can check the active version using - -```py ->>> import sys ->>> sys.version -# Prints out Python version here. -``` - -That being said, most of tbe examples do work as expected. If you face any trouble, feel free to consult the original content on wtfpython and create an issue in the repo. Have fun! - - diff --git a/irrelevant/obsolete/add_categories b/irrelevant/obsolete/add_categories index 7818b2c..5eed768 100644 --- a/irrelevant/obsolete/add_categories +++ b/irrelevant/obsolete/add_categories @@ -139,7 +139,7 @@ f* Half triple-quoted strings f -Implicity key type conversion +Implicit key type conversion f* Stubborn `del` operator diff --git a/irrelevant/wtf.ipynb b/irrelevant/wtf.ipynb index 12c7bb8..de1cba2 100644 --- a/irrelevant/wtf.ipynb +++ b/irrelevant/wtf.ipynb @@ -1044,7 +1044,7 @@ " \n", " > Equality tests between OrderedDict objects are order-sensitive and are implemented as `list(od1.items())==list(od2.items())`. Equality tests between `OrderedDict` objects and other Mapping objects are order-insensitive like regular dictionaries.\n", "- The reason for this equality is behavior is that it allows `OrderedDict` objects to be directly substituted anywhere a regular dictionary is used.\n", - "- Okay, so why did changing the order affect the lenght of the generated `set` object? The answer is the lack of intransitive equality only. Since sets are \"unordered\" collections of unique elements, the order in which elements are inserted shouldn't matter. But in this case, it does matter. Let's break it down a bit,\n" + "- Okay, so why did changing the order affect the length of the generated `set` object? The answer is the lack of intransitive equality only. Since sets are \"unordered\" collections of unique elements, the order in which elements are inserted shouldn't matter. But in this case, it does matter. Let's break it down a bit,\n" ] }, { @@ -1289,7 +1289,7 @@ " print(\"Iteration\", i)\n", " break\n", " except ZeroDivisionError as e:\n", - " print(\"Zero division error ocurred\", e)\n" + " print(\"Zero division error occurred\", e)\n" ] }, {