Python: Class attribute vs. List Index -


i have list of 'purchase' objects stored in list. subset of list, complex analysis, , update properties of purchase objects, based on analysis.

if grab subset of purchase records using list comprehension, copies of objects, copies of these objects, must have way of going , updating master list.

if add 'id' attribute purchase class. can object in master list id, able find index, faster. considered using dictionary key being identity, somehow feel missing obvious solution.

to clarify main issue here, list index of subset cannot used find original object in master list want update.


Comments

Popular posts from this blog

mysql - How to unscape text from database in android studio -

php - Admin SDK -- get information about the group -

Making CSS Drop Down Menu 2 Columns -