Message361954
In a few of my projects I had this (minor) pain of having to remember which collections of elements are sets and which are [list, tuple]. It causes me to double check and have random.sample(my_set, 1)[0] in many places.
To me this is not how I think and causes friction: conceptually, I know something is a collection and I want 1 random choice from it. Having to differentiate on sequences vs sets makes my code uglier :(
This issue is similar to https://bugs.python.org/issue37708. |
|
Date |
User |
Action |
Args |
2020-02-13 12:59:45 | Ilya Kamenshchikov | set | recipients:
+ Ilya Kamenshchikov |
2020-02-13 12:59:45 | Ilya Kamenshchikov | set | messageid: <1581598785.79.0.74304854999.issue39626@roundup.psfhosted.org> |
2020-02-13 12:59:45 | Ilya Kamenshchikov | link | issue39626 messages |
2020-02-13 12:59:45 | Ilya Kamenshchikov | create | |
|