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:
Dave Halter
2014-08-12 17:59:09 +02:00
parent 6f018e4884
commit 8ed89e8245
3 changed files with 59 additions and 3 deletions

View File

@@ -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