diff --git a/jedi/parsing.py b/jedi/parsing.py index af17df34..b3f20e92 100644 --- a/jedi/parsing.py +++ b/jedi/parsing.py @@ -709,7 +709,7 @@ class Statement(Simple): raise else: if tok in ['return', 'yield'] or level == 0 and \ - '=' in tok and not tok in ['>=', '<=', '==', '!=']: + tok.endswith('=') and not tok in ['>=', '<=', '==', '!=']: # This means, there is an assignment here. # Add assignments, which can be more than one diff --git a/test/completion/types.py b/test/completion/types.py index 1dfc11b2..a29c1511 100644 --- a/test/completion/types.py +++ b/test/completion/types.py @@ -20,6 +20,11 @@ float.is_int #? ['upper'] r"".upper +# strangely this didn't work, because the = is used for assignments +#? ['upper'] +"=".upper + + # ----------------- # lists # -----------------