mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 06:44:46 +08:00
implement !=, ==, is, is not operators to work in if statements (they also work in in non if contexts and return a bool value.), includes tests.
This commit is contained in:
@@ -88,12 +88,41 @@ def check(a):
|
||||
if a is None:
|
||||
return 1
|
||||
return ''
|
||||
return set
|
||||
|
||||
#? int()
|
||||
check(None)
|
||||
#? str()
|
||||
check('asb')
|
||||
|
||||
a = list
|
||||
if 2 == True:
|
||||
a = set
|
||||
elif 1 == True:
|
||||
a = 0
|
||||
|
||||
#? int()
|
||||
a
|
||||
if check != 1:
|
||||
a = ''
|
||||
#? str()
|
||||
a
|
||||
if check == check:
|
||||
a = list
|
||||
#? list
|
||||
a
|
||||
if check != check:
|
||||
a = set
|
||||
else:
|
||||
a = dict
|
||||
#? dict
|
||||
a
|
||||
if (check is not check):
|
||||
a = 1
|
||||
#? dict
|
||||
a
|
||||
|
||||
|
||||
# -----------------
|
||||
# name resolution
|
||||
# -----------------
|
||||
@@ -121,5 +150,3 @@ else:
|
||||
|
||||
#? int
|
||||
a
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user