views:

57

answers:

2

I'm using the same test code in cPython and IronPython, in cPython it works but I'm getting "name all is not defined" in IronPython in asp.net . I wonder if I have to import some module to use it in IronPython or it's just not available?

lista = ['a','b']
listados = ['a','b','c']

aca = all(value in listados for value in lista)
+1  A: 

What version of IronPython are you running? all() is a fairly recent Python addition (2.5).

Ken
+1  A: 

The all and any functions were added in Python 2.5. Are you using at least version 2.5 of IronPython? If not, it's fairly easy to define a fallback version:

try: all
except NameError:
    def all(iterable):
        for value in iterable:
            if not value: return False
        return True
Edward Loper
oh, it was that. thx.
Pablo