[Python-Dev] RFC: PEP 509: Add a private version to dict
Victor Stinner
victor.stinner at gmail.com
Fri Apr 15 17:19:10 EDT 2016
More information about the Python-Dev mailing list
Fri Apr 15 17:19:10 EDT 2016
- Previous message (by thread): [Python-Dev] RFC: PEP 509: Add a private version to dict
- Next message (by thread): [Python-Dev] RFC: PEP 509: Add a private version to dict
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
2016-04-15 23:07 GMT+02:00 Random832 <random832 at fastmail.com>: > Why is iterating over items different from iterating over keys? > > in other words, why do I have to write: > > for k in dict: > v = dict[k] > ...do some stuff... > dict[k] = something > > rather than > > for k, v in dict.items(): > ...do some stuff... > dict[k] = something > > It's not clear why the latter is something you want to prevent. Hum, I think that you misunderstood what should be prevented. Please see https://bugs.python.org/issue19332 Sorry, I don't know well this issue. I just know that sadly the PEP 509 doesn't help to fix this issue. Maybe it's not worth to mention it... Victor
- Previous message (by thread): [Python-Dev] RFC: PEP 509: Add a private version to dict
- Next message (by thread): [Python-Dev] RFC: PEP 509: Add a private version to dict
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list