hi. been programming in python a while now and very much like the easy of dev and conciseness of the code. however one thing i miss is the ability in c++ to use an iterator to find a specific object in a say a vector (with one stmt). then, to be able to pass that iterator to other routines with one var only (the iterator itself) and still have access to the whole vector in the called routine. in python i have been doing this:
then, passing both pos (my would-be iterator) and also subList around to any routine where i need it.Code:pos=0 for pos,abar in enumerate(subList): if abar.date==dte.date: break
this is clumsy since i use multiple statements for the find (i'm pretty sure there is a list function i should be using instead of course), but then need to pass around both the position number and also the list variables.
is there a more readable way to do this?