Move to python 3.6 intersphinx.

This commit is contained in:
Dave Halter
2017-09-03 23:32:43 +02:00
parent 5993765e0a
commit 7a277c7302
6 changed files with 20 additions and 24 deletions

View File

@@ -274,7 +274,7 @@ autodoc_default_flags = []
# -- Options for intersphinx module --------------------------------------------
intersphinx_mapping = {
'http://docs.python.org/': None,
'http://docs.python.org/': ('https://docs.python.org/3.6', None),
}

View File

@@ -3,13 +3,7 @@
Parser Tree
===========
Usage
-----
.. automodule:: parso.python
:members:
:undoc-members:
The parser tree is returned by calling :py:meth:`parso.Grammar.parse`.
Parser Tree Base Class
----------------------

View File

@@ -30,9 +30,9 @@ __version__ = '0.0.5'
def parse(code=None, **kwargs):
"""
A utility function to avoid loading grammars.
Params are documented in :py:meth:`parso.Grammar.parse`
Params are documented in :py:meth:`parso.Grammar.parse`.
:param string version: The version used by :py:func:`parso.Grammar.load_grammar`.
:param str version: The version used by :py:func:`parso.load_grammar`.
"""
version = kwargs.pop('version', None)
grammar = load_grammar(version=version)

View File

@@ -47,7 +47,7 @@ class Grammar(object):
:param str code: A unicode or bytes string. When it's not possible to
decode bytes to a string, returns a
:py:class:`exceptions.UnicodeDecodeError`.
:py:class:`UnicodeDecodeError`.
:param bool error_recovery: If enabled, any code will be returned. If
it is invalid, it will be returned as an error node. If disabled,
you will get a ParseError when encountering syntax errors in your

View File

@@ -1,16 +1,18 @@
"""
If you know what an syntax tree is, you'll see that this module is pretty much
that. The classes represent syntax elements like functions and imports.
This is the syntax tree for Python syntaxes (2 & 3). The classes represent
syntax elements like functions and imports.
This is the "business logic" part of the parser. There's a lot of logic here
that makes it easier for Jedi (and other libraries) to deal with a Python syntax
tree.
All of the nodes can be traced back to the `Python grammar file
<https://docs.python.org/3/reference/grammar.html>`_. If you want to know how
a tree is structured, just analyse that file (for each Python version it's a
bit different).
By using `get_code` on a module, you can get back the 1-to-1 representation of
the input given to the parser. This is important if you are using refactoring.
There's a lot of logic here that makes it easier for Jedi (and other libraries)
to deal with a Python syntax tree.
The easiest way to play with this module is to use :class:`parsing.Parser`.
:attr:`parsing.Parser.module` holds an instance of :class:`Module`:
By using :py:meth:`parso.tree.NodeOrLeaf.get_code` on a module, you can get
back the 1-to-1 representation of the input given to the parser. This is
important if you are using refactoring.
>>> from parso import parse
>>> parser = parse('import os')

View File

@@ -14,7 +14,7 @@ def split_lines(string, keepends=False):
Intended for Python code. In contrast to Python's :py:meth:`str.splitlines`,
looks at form feeds and other special characters as normal text. Just
splits ``\n`` and ``\r\n``.
Also different: Returns ``['']`` for an empty string input.
Also different: Returns ``[""]`` for an empty string input.
In Python 2.7 form feeds are used as normal characters when using
str.splitlines. However in Python 3 somewhere there was a decision to split
@@ -51,10 +51,10 @@ def split_lines(string, keepends=False):
def python_bytes_to_unicode(source, encoding='utf-8', errors='strict'):
"""
Checks for unicode BOMs and PEP 263 encoding declarations. Then returns a
unicode object like in :py:meth:`str.decode`.
unicode object like in :py:meth:`bytes.decode`.
:param encoding: See :py:meth:`str.decode` documentation.
:param errors: See :py:meth:`str.decode` documentation. ``errors`` can be
:param encoding: See :py:meth:`bytes.decode` documentation.
:param errors: See :py:meth:`bytes.decode` documentation. ``errors`` can be
``'strict'``, ``'replace'`` or ``'ignore'``.
"""
def detect_encoding():