From ddfa1ba012793927a1380e6d0fdbb5291b850b62 2018-01-16 20:47:57 From: luz.paz Date: 2018-01-16 20:47:57 Subject: [PATCH] Misc. typos fixes Found via `codespell` --- diff --git a/IPython/core/compilerop.py b/IPython/core/compilerop.py index e5f619c..3dc083c 100644 --- a/IPython/core/compilerop.py +++ b/IPython/core/compilerop.py @@ -136,7 +136,7 @@ class CachingCompiler(codeop.Compile): def check_linecache_ipython(*args): """Call linecache.checkcache() safely protecting our cached values. """ - # First call the orignal checkcache as intended + # First call the original checkcache as intended linecache._checkcache_ori(*args) # Then, update back the cache with our data, so that tracebacks related # to our compiled codes can be produced. diff --git a/IPython/core/completer.py b/IPython/core/completer.py index 4c817c9..f597136 100644 --- a/IPython/core/completer.py +++ b/IPython/core/completer.py @@ -2005,7 +2005,7 @@ class IPCompleter(Completer): # FIXME: we should extend our api to return a dict with completions for # different types of objects. The rlcomplete() method could then # simply collapse the dict into a list for readline, but we'd have - # richer completion semantics in other evironments. + # richer completion semantics in other environments. completions = () if self.use_jedi: if not full_text: diff --git a/IPython/core/history.py b/IPython/core/history.py index 4d3719e..4f70487 100644 --- a/IPython/core/history.py +++ b/IPython/core/history.py @@ -179,7 +179,7 @@ class HistoryAccessor(HistoryAccessorBase): help="""Options for configuring the SQLite connection These options are passed as keyword args to sqlite3.connect - when establishing database conenctions. + when establishing database connections. """ ).tag(config=True) diff --git a/IPython/core/magics/code.py b/IPython/core/magics/code.py index 0c82b7f..d16a569 100644 --- a/IPython/core/magics/code.py +++ b/IPython/core/magics/code.py @@ -53,7 +53,7 @@ $""", re.VERBOSE) def extract_code_ranges(ranges_str): """Turn a string of range for %%load into 2-tuples of (start, stop) - ready to use as a slice of the content splitted by lines. + ready to use as a slice of the content split by lines. Examples -------- diff --git a/IPython/core/splitinput.py b/IPython/core/splitinput.py index 7b95772..f8bf623 100644 --- a/IPython/core/splitinput.py +++ b/IPython/core/splitinput.py @@ -114,7 +114,7 @@ class LineInfo(object): self.pre_char = self.pre.strip() if self.pre_char: - self.pre_whitespace = '' # No whitespace allowd before esc chars + self.pre_whitespace = '' # No whitespace allowed before esc chars else: self.pre_whitespace = self.pre diff --git a/IPython/core/tests/test_completer.py b/IPython/core/tests/test_completer.py index a6f6db7..b7012ce 100644 --- a/IPython/core/tests/test_completer.py +++ b/IPython/core/tests/test_completer.py @@ -367,8 +367,8 @@ def test_greedy_completions(): """ Test the capability of the Greedy completer. - Most of the test here do not really show off the greedy completer, for proof - each of the text bellow now pass with Jedi. The greedy completer is capable of more. + Most of the test here does not really show off the greedy completer, for proof + each of the text below now pass with Jedi. The greedy completer is capable of more. See the :any:`test_dict_key_completion_contexts` diff --git a/IPython/lib/display.py b/IPython/lib/display.py index 93547b0..69601dc 100644 --- a/IPython/lib/display.py +++ b/IPython/lib/display.py @@ -424,7 +424,7 @@ class FileLinks(FileLink): raise ValueError("Cannot display a file using FileLinks. " "Use FileLink to display '%s'." % path) self.included_suffixes = included_suffixes - # remove trailing slashs for more consistent output formatting + # remove trailing slashes for more consistent output formatting path = path.rstrip('/') self.path = path diff --git a/IPython/lib/editorhooks.py b/IPython/lib/editorhooks.py index b203e21..7ce0577 100644 --- a/IPython/lib/editorhooks.py +++ b/IPython/lib/editorhooks.py @@ -29,7 +29,7 @@ def install_editor(template, wait=False): template : basestring run_template acts as a template for how your editor is invoked by the shell. It should contain '{filename}', which will be replaced on - invokation with the file name, and '{line}', $line by line number + invocation with the file name, and '{line}', $line by line number (or 0) to invoke the file with. wait : bool If `wait` is true, wait until the user presses enter before returning, diff --git a/IPython/lib/inputhookglut.py b/IPython/lib/inputhookglut.py index b4a7f3c..e6f7f12 100644 --- a/IPython/lib/inputhookglut.py +++ b/IPython/lib/inputhookglut.py @@ -112,7 +112,7 @@ def glut_close(): glutMainLoopEvent() def glut_int_handler(signum, frame): - # Catch sigint and print the defautl message + # Catch sigint and print the default message signal.signal(signal.SIGINT, signal.default_int_handler) print('\nKeyboardInterrupt') # Need to reprint the prompt at this stage diff --git a/IPython/sphinxext/ipython_directive.py b/IPython/sphinxext/ipython_directive.py index e166f4b..a0e6728 100644 --- a/IPython/sphinxext/ipython_directive.py +++ b/IPython/sphinxext/ipython_directive.py @@ -114,7 +114,7 @@ To Do Authors ------- -- John D Hunter: orignal author. +- John D Hunter: original author. - Fernando Perez: refactoring, documentation, cleanups, port to 0.11. - VáclavŠmilauer : Prompt generalizations. - Skipper Seabold, refactoring, cleanups, pure python addition diff --git a/IPython/testing/tools.py b/IPython/testing/tools.py index 70be93b..83fb1b7 100644 --- a/IPython/testing/tools.py +++ b/IPython/testing/tools.py @@ -250,7 +250,7 @@ def ipexec_validate(fname, expected_out, expected_err='', out, err = ipexec(fname, options, commands) #print 'OUT', out # dbg #print 'ERR', err # dbg - # If there are any errors, we must check those befor stdout, as they may be + # If there are any errors, we must check those before stdout, as they may be # more informative than simply having an empty stdout. if err: if expected_err: diff --git a/IPython/utils/tests/test_text.py b/IPython/utils/tests/test_text.py index ad53303..d1666b9 100644 --- a/IPython/utils/tests/test_text.py +++ b/IPython/utils/tests/test_text.py @@ -64,7 +64,7 @@ def test_columnize(): def test_columnize_random(): - """Test with random input to hopfully catch edge case """ + """Test with random input to hopefully catch edge case """ for row_first in [True, False]: for nitems in [random.randint(2,70) for i in range(2,20)]: displaywidth = random.randint(20,200) diff --git a/IPython/utils/tokenize2.py b/IPython/utils/tokenize2.py index be48b71..97ac18d 100644 --- a/IPython/utils/tokenize2.py +++ b/IPython/utils/tokenize2.py @@ -297,7 +297,7 @@ def _get_normal_name(orig_enc): def detect_encoding(readline): """ The detect_encoding() function is used to detect the encoding that should - be used to decode a Python source file. It requires one argment, readline, + be used to decode a Python source file. It requires one argument, readline, in the same way as the tokenize() generator. It will call readline a maximum of twice, and return the encoding used @@ -383,7 +383,7 @@ def open(filename): def tokenize(readline): """ - The tokenize() generator requires one argment, readline, which + The tokenize() generator requires one argument, readline, which must be a callable object which provides the same interface as the readline() method of built-in file objects. Each call to the function should return one line of input as bytes. Alternately, readline diff --git a/docs/source/config/details.rst b/docs/source/config/details.rst index 9347066..e1ce0f3 100644 --- a/docs/source/config/details.rst +++ b/docs/source/config/details.rst @@ -243,7 +243,7 @@ behavior is to likely to insert a new line. If the current code is a simple statement like `ord('*')`, then the right behavior is likely to execute. Though the exact desired semantics often varies from users to users. -As the exact behavior of :kbd:`Enter` is is ambiguous, it has been special cased +As the exact behavior of :kbd:`Enter` is ambiguous, it has been special cased to allow users to completely configure the behavior they like. Hence you can have enter always execute code. If you prefer fancier behavior, you need to get your hands dirty and read the ``prompt_toolkit`` and IPython documentation diff --git a/docs/source/install/kernel_install.rst b/docs/source/install/kernel_install.rst index 3949f9a..c75f32c 100644 --- a/docs/source/install/kernel_install.rst +++ b/docs/source/install/kernel_install.rst @@ -51,7 +51,7 @@ Kernels for different environments If you want to have multiple IPython kernels for different virtualenvs or conda environments, you will need to specify unique names for the kernelspecs. -Make sure you have ipykernel installed in your environement. If you are using +Make sure you have ipykernel installed in your environment. If you are using ``pip`` to install ``ipykernel`` in a conda env, make sure ``pip`` is installed: diff --git a/docs/source/whatsnew/github-stats-2.0.rst b/docs/source/whatsnew/github-stats-2.0.rst index 4fe6f19..826b471 100644 --- a/docs/source/whatsnew/github-stats-2.0.rst +++ b/docs/source/whatsnew/github-stats-2.0.rst @@ -800,7 +800,7 @@ Pull Requests (687): * :ghpull:`4768`: Qt console: Fix _prompt_pos accounting on timer flush output. * :ghpull:`4727`: Remove Nbconvert template loading magic * :ghpull:`4763`: Set numpydoc options to produce fewer Sphinx warnings. -* :ghpull:`4770`: alway define aliases, even if empty +* :ghpull:`4770`: always define aliases, even if empty * :ghpull:`4766`: add `python -m` entry points for everything * :ghpull:`4767`: remove manpages for irunner, iplogger * :ghpull:`4751`: Added --post-serve explanation into the nbconvert docs. diff --git a/examples/IPython Kernel/Beyond Plain Python.ipynb b/examples/IPython Kernel/Beyond Plain Python.ipynb index ec24fc6..50c123f 100644 --- a/examples/IPython Kernel/Beyond Plain Python.ipynb +++ b/examples/IPython Kernel/Beyond Plain Python.ipynb @@ -1351,7 +1351,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Don't foget to exit your debugging session. Raw input can of course be use to ask for user input:" + "Don't forget to exit your debugging session. Raw input can of course be used to ask for user input:" ] }, { @@ -2483,7 +2483,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "We can connect automatically a Qt Console to the currently running kernel with the `%qtconsole` magic, or by typing `ipython console --existing ` in any terminal:" + "We can automatically connect a Qt Console to the currently running kernel with the `%qtconsole` magic, or by typing `ipython console --existing ` in any terminal:" ] }, { diff --git a/tools/backport_pr.py b/tools/backport_pr.py index 6eee816..c4c06b5 100755 --- a/tools/backport_pr.py +++ b/tools/backport_pr.py @@ -161,7 +161,7 @@ def should_backport(labels=None, milestone=None, project='ipython/ipython'): if __name__ == '__main__': project = 'ipython/ipython' - print("DEPRECATE: backport_pr.py is deprecated and is is now recommended" + print("DEPRECATE: backport_pr.py is deprecated and it is now recommended" "to install `ghpro` from PyPI.", file=sys.stderr) args = list(sys.argv) diff --git a/tools/gen_latex_symbols.py b/tools/gen_latex_symbols.py index b456c5d..7eb6844 100644 --- a/tools/gen_latex_symbols.py +++ b/tools/gen_latex_symbols.py @@ -45,7 +45,7 @@ lines = [line_to_tuple(line) for line in lines] print('Filtering out characters that are not valid Python 3 identifiers') def test_ident(i): - """Is the unicode string valid in a Python 3 identifer.""" + """Is the unicode string valid in a Python 3 identifier.""" # Some characters are not valid at the start of a name, but we still want to # include them. So prefix with 'a', which is valid at the start. return ('a' + i).isidentifier() diff --git a/tools/github_stats.py b/tools/github_stats.py index bbacc0a..ecde110 100755 --- a/tools/github_stats.py +++ b/tools/github_stats.py @@ -110,7 +110,7 @@ def report(issues, show_urls=False): if __name__ == "__main__": - print("DEPRECATE: backport_pr.py is deprecated and is is now recommended" + print("DEPRECATE: backport_pr.py is deprecated and it is now recommended" "to install `ghpro` from PyPI.", file=sys.stderr) diff --git a/tools/tests/CSS Reference.ipynb b/tools/tests/CSS Reference.ipynb index b1df3f9..a9e0c74 100644 --- a/tools/tests/CSS Reference.ipynb +++ b/tools/tests/CSS Reference.ipynb @@ -75,7 +75,7 @@ "\n", "```\n", "def some_other_code():\n", - " return 'bewtween_backticks'\n", + " return 'between_backticks'\n", "```" ] }, @@ -83,7 +83,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "You can look at different level of nested unorderd list \n", + "You can look at different level of nested unordered list \n", "\n", "- level 1\n", " - level 2\n",