diff options
author | Sylvain Thénault <sylvain.thenault@logilab.fr> | 2008-03-30 19:25:58 +0200 |
---|---|---|
committer | Sylvain Thénault <sylvain.thenault@logilab.fr> | 2008-03-30 19:25:58 +0200 |
commit | 6b636000eceef3ac91a3fa40911291a95b73244f (patch) | |
tree | b8b24ee94a64ef323c764b934dbc99b1be167160 /inference.py | |
parent | df7e6961f4887e58d9eb957a556868f095db9017 (diff) | |
download | astroid-git-6b636000eceef3ac91a3fa40911291a95b73244f.tar.gz |
_ast compat step 1
--HG--
branch : _ast_compat
Diffstat (limited to 'inference.py')
-rw-r--r-- | inference.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/inference.py b/inference.py index fba9cde3..22f546db 100644 --- a/inference.py +++ b/inference.py @@ -27,12 +27,24 @@ from copy import copy from logilab.common.compat import imap, chain, set -from logilab.astng import MANAGER, YES, InferenceContext, Instance, Generator, \ +from logilab.astng import MANAGER, InferenceContext, \ unpack_infer, _infer_stmts, nodes, copy_context, path_wrapper from logilab.astng import ASTNGError, InferenceError, UnresolvableName, \ NoDefault, NotFoundError, ASTNGBuildingException -from logilab.astng.utils import infer_end, end_ass_type +from logilab.astng.utils import YES, Instance, Generator, infer_end, end_ass_type +nodes.List._proxied = MANAGER.astng_from_class(list) +nodes.List.__bases__ += (Instance,) +nodes.List.pytype = lambda x: '__builtin__.list' +nodes.Tuple._proxied = MANAGER.astng_from_class(tuple) +nodes.Tuple.__bases__ += (Instance,) +nodes.Tuple.pytype = lambda x: '__builtin__.tuple' +nodes.Dict.__bases__ += (Instance,) +nodes.Dict._proxied = MANAGER.astng_from_class(dict) +nodes.Dict.pytype = lambda x: '__builtin__.dict' + +builtin_astng = nodes.Dict._proxied.root() + # .infer method ############################################################### @@ -548,3 +560,5 @@ nodes.For.loop_node = for_loop_node if nodes.AST_MODE == 'compiler': from logilab.astng._inference_compiler import * +else: #nodes.AST_MODE == '_ast' + from logilab.astng._inference_ast import * |