New submission from Ilya Kamenshchikov <ikamenshchi...@gmail.com>:

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.

----------
components: Library (Lib)
messages: 361954
nosy: Ilya Kamenshchikov
priority: normal
severity: normal
status: open
title: random choice to delegate to sample on sets

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39626>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to