Clearly, you didn't take enough attention to the RemcoGerlich's comment, since you upvoted and accepted a senseless answer.
At the time I write this, 4 other people upvoted the same senseless answer.
That's incredible.
Will you see better with this ? :
def OP(a,b,c):
return not isinstance(a, int)\
or not isinstance(b, int)\
or not isinstance(c, int)\
or not isinstance(a, float)\
or not isinstance(b, float)\
or not isinstance(c, float)
def AZ(a,b,c):
return all(isinstance(var, (int, float))
for var in [a, b, c])
gen = ((a,b,c) for a in (1, 1.1 ,'a')
for b in (2, 2.2, 'b') for c in (3, 3.3, 'c'))
print ' OPv | AZv OPv is AZv\n'\
' -----|----- -----------'
OPV_list = []
for a,b,c in gen:
OPv = OP(a,b,c)
OPV_list.append(OPv)
AZv = AZ(a,b,c)
print '%3r %3r %3r %s | %s %s'\
% (a,b,c,OPv,AZv,OPv is AZv if OPv is not AZv else '')
print '------------- ----'
print 'all(OPV_list) : ',all(OPV_list)
result
OPv = yours
AZv = senseless answer
I limited to a,b,c to make it short
OPv | AZv OPv is AZv
-----|----- -----------
1 2 3 True | True
1 2 3.3 True | True
1 2 'c' True | False False
1 2.2 3 True | True
1 2.2 3.3 True | True
1 2.2 'c' True | False False
1 'b' 3 True | False False
1 'b' 3.3 True | False False
1 'b' 'c' True | False False
1.1 2 3 True | True
1.1 2 3.3 True | True
1.1 2 'c' True | False False
1.1 2.2 3 True | True
1.1 2.2 3.3 True | True
1.1 2.2 'c' True | False False
1.1 'b' 3 True | False False
1.1 'b' 3.3 True | False False
1.1 'b' 'c' True | False False
'a' 2 3 True | False False
'a' 2 3.3 True | False False
'a' 2 'c' True | False False
'a' 2.2 3 True | False False
'a' 2.2 3.3 True | False False
'a' 2.2 'c' True | False False
'a' 'b' 3 True | False False
'a' 'b' 3.3 True | False False
'a' 'b' 'c' True | False False
------------- ----
all(OPV_list) : True