Entries created on Mon, 13 Sep 2004


Cleanest Python find-in-list function?

I'm trying to find a Python built-in that will return the first item i in a sequence that given a function f returns i when f(i) == True. I need this about every 300 lines of code or so (that's actually quite a bit of code in Python). The general use-case is running through a list looking for an item matching some criteria and then returning it. This is more commonly dictionary-land (i.e. the items should be stored in a dict keyed by the criteria instead of a list) but that's not always practical/needed.

To python coding weblog ... on Mon 09/13/04 at 05:46 AM

Python Built-in Functions
- List of built in functions (i.e. non-module) in Python.
To links coding python reference ... on Mon 09/13/04 at 05:07 AM