You can just do:
x.FindAll(lambda inst:True)
or:
def MyPredicate(obj):
return True
x.FindAll(MyPredicate)
> -----Original Message-----
> From: [email protected] [mailto:users-
> [email protected]] On Behalf Of Count László de Almásy
> Sent: Friday, July 24, 2009 12:04 AM
> To: Discussion of IronPython
> Subject: [IronPython] how to use Predicates in IPy?
>
> I've been unable to find any examples of how to define/use Predicates
> in IPy, as for use with .NET's List(T).FindAll method. Specifically
> I'm trying to use
> http://lib.openmetaverse.org/docs/trunk/html/M_OpenMetaverse_InternalDi
> ctionary_2_FindAll_1.htm
>
> Anyway, if someone could help with an example of how to do such things
> in IPy I'd greatly appreciate. The one mention of it in this list's
> archives is from 2006 and refers to an example url that is now broken.
>
> --
> Cheers, László
> _______________________________________________
> Users mailing list
> [email protected]
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com