diff --git a/docs/docs/development.rst b/docs/docs/development.rst index 0e107c43..abe43f39 100644 --- a/docs/docs/development.rst +++ b/docs/docs/development.rst @@ -64,21 +64,23 @@ The parser creates a syntax tree that |jedi| analyses and tries to understand. The grammar that this parsers uses is very similar to the official Python `grammar files `_. +.. _evaluate: + Evaluation of python code (evaluate/__init__.py) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. automodule:: jedi.evaluate -Evaluation Representation (evaluate/representation.py) +Evaluation Contexts (evaluate/base_context.py) ++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.. automodule:: jedi.evaluate.representation +.. automodule:: jedi.evaluate.base_context .. inheritance-diagram:: - jedi.evaluate.instance.TreeInstance - jedi.evaluate.representation.ClassContext - jedi.evaluate.representation.FunctionContext - jedi.evaluate.representation.FunctionExecutionContext + jedi.evaluate.context.instance.TreeInstance + jedi.evaluate.context.klass.ClassContext + jedi.evaluate.context.function.FunctionContext + jedi.evaluate.context.function.FunctionExecutionContext :parts: 1 @@ -111,7 +113,6 @@ Core Extensions is a summary of the following topics: - :ref:`Iterables & Dynamic Arrays ` - :ref:`Dynamic Parameters ` -- :ref:`Diff Parser ` - :ref:`Docstrings ` - :ref:`Refactoring ` @@ -121,13 +122,13 @@ without some features. .. _iterables: -Iterables & Dynamic Arrays (evaluate/iterable.py) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Iterables & Dynamic Arrays (evaluate/context/iterable.py) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To understand Python on a deeper level, |jedi| needs to understand some of the dynamic features of Python like lists that are filled after creation: -.. automodule:: jedi.evaluate.iterable +.. automodule:: jedi.evaluate.context.iterable .. _dynamic: diff --git a/jedi/_compatibility.py b/jedi/_compatibility.py index 334925e0..8b55fb8f 100644 --- a/jedi/_compatibility.py +++ b/jedi/_compatibility.py @@ -268,7 +268,7 @@ def use_metaclass(meta, *bases): """ Create a class with a metaclass. """ if not bases: bases = (object,) - return meta("HackClass", bases, {}) + return meta("Py2CompatibilityMetaClass", bases, {}) try: diff --git a/jedi/evaluate/__init__.py b/jedi/evaluate/__init__.py index e61b144b..3ba52b89 100644 --- a/jedi/evaluate/__init__.py +++ b/jedi/evaluate/__init__.py @@ -17,7 +17,8 @@ said, the typical entry point for static analysis is calling ``eval_expr_stmt``. There's separate logic for autocompletion in the API, the evaluator is all about evaluating an expression. -TODO this paragraph is not what jedi does anymore. +TODO this paragraph is not what jedi does anymore, it's similar, but not the +same. Now you need to understand what follows after ``eval_expr_stmt``. Let's make an example:: diff --git a/jedi/evaluate/base_context.py b/jedi/evaluate/base_context.py index 0f0413ac..2c6fe6cd 100644 --- a/jedi/evaluate/base_context.py +++ b/jedi/evaluate/base_context.py @@ -1,3 +1,11 @@ +""" +Contexts are the "values" that Python would return. However Contexts are at the +same time also the "contexts" that a user is currently sitting in. + +A ContextSet is typically used to specify the return of a function or any other +static analysis operation. In jedi there are always multiple returns and not +just one. +""" from parso.python.tree import ExprStmt, CompFor from jedi import debug