From 7d73e571bb168416f8a7a31ae434fcdb55df1b92 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Fri, 27 Jun 2014 11:56:40 +0200 Subject: [PATCH] json.load[s] shouldn't return any results. fixed by overwriting the method --- jedi/evaluate/stdlib.py | 4 ++++ test/completion/stdlib.py | 17 +++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/jedi/evaluate/stdlib.py b/jedi/evaluate/stdlib.py index c1798a01..adb2a3ef 100644 --- a/jedi/evaluate/stdlib.py +++ b/jedi/evaluate/stdlib.py @@ -124,4 +124,8 @@ _implemented = { 'copy': _return_first_param, 'deepcopy': _return_first_param, }, + 'json': { + 'load': lambda *args: [], + 'loads': lambda *args: [], + }, } diff --git a/test/completion/stdlib.py b/test/completion/stdlib.py index e09ea268..332a9976 100644 --- a/test/completion/stdlib.py +++ b/test/completion/stdlib.py @@ -133,10 +133,19 @@ hashlib.md5 # ----------------- import copy -a = copy.deepcopy(1) #? int() -a +copy.deepcopy(1) -a = copy.copy() #? -a +copy.copy() + +# ----------------- +# json +# ----------------- + +# We don't want any results for json, because it depends on IO. +import json +#? +json.load('asdf') +#? +json.loads('[1]')