Message302803
They behave like sets yet their repr looks like a list: dict_keys([0, 1, 3, 4]). It should be dict_keys({0, 1, 2, 3, 4}). Ditto for odict_keys/odict_values. Maybe this is a holdover from when the repr of sets was Set([0, 1, 2, ...])?
The reason I bring this up is that they behave like sets was one of the last things I learned. I learned about stuff like abcs, metaclasses (including stuff like __prepare__ and __init_subclass__) and memorized practically all of the standard library long before I realized this.
I don't think it would break anything to do this and it could help dummies like me realize their set-like behavior sooner.
It might also be nice to give them the explicit `symmetric_difference`, `union`, and `intersection` methods in addition to the respective `__xor__`, `__or__`, and `__and__` methods. |
|
Date |
User |
Action |
Args |
2017-09-23 20:29:10 | bup | set | recipients:
+ bup |
2017-09-23 20:29:10 | bup | set | messageid: <1506198550.29.0.696605972166.issue31563@psf.upfronthosting.co.za> |
2017-09-23 20:29:10 | bup | link | issue31563 messages |
2017-09-23 20:29:10 | bup | create | |
|