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

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -