From ee9676a5d71e9504925b2ffe767a4096c8937e18 Mon Sep 17 00:00:00 2001 From: David Halter Date: Tue, 5 Feb 2013 00:39:48 +0100 Subject: [PATCH] improved evaluate docstring --- jedi/evaluate.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/jedi/evaluate.py b/jedi/evaluate.py index 3efd3b8d..347074fa 100644 --- a/jedi/evaluate.py +++ b/jedi/evaluate.py @@ -1,6 +1,22 @@ """ -This is the core part of jedi. Most of the logic, how to evaluate certain -objects (imports, etc.) is here. +.. warning:: I know this module is very messy. It's hard to write proper code + if so much of your work relies on try & error. Sometimes it's just not + possible for a small mind like mine to understand the problem, because + it happens after a 50 function calls deep recursion. I know refactoring + is necessary, but it's not that easy to find that time. + +Evaluation of Python code in |jedi| is based on three assumptions: + +* Code is recursive (to weaken this assumption, the :mod:`dynamic` module + exists). +* No magic is being used: + + - metaclasses + - ``setattr()`` / ``__import__()`` + - writing to ``globals()``, ``locals()``, ``object.__dict__`` +* The programmer is not a total dick, e.g. like `this + `_ :-) + The functions should be described in their docstrings. However, there are some classes, which are used to store the values. After those classes, there are the