[Python-checkins] python/dist/src/Misc NEWS,1.831.4.34,1.831.4.35

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Fri Sep 5 15:40:32 EDT 2003


Update of /cvsroot/python/python/dist/src/Misc
In directory sc8-pr-cvs1:/tmp/cvs-serv8317/Misc

Modified Files:
      Tag: release23-maint
	NEWS 
Log Message:
SF bug #801342:  Bug (documentation or real, your choice) in random.sample.

random.sample() uses one of two algorithms depending on the ratio of the
sample size to the population size.  One of the algorithms accepted any
iterable population argument so long as it defined __len__().  The other
had a stronger requirement that the population argument be indexable.

While it met the documentation specifications which insisted that the
population argument be a sequence, it made random.sample() less usable
with sets.  So, the second algorithm was modified to coerce non-indexable
iterables and dictionaries into a tuple before proceeding.



Index: NEWS
===================================================================
RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v
retrieving revision 1.831.4.34
retrieving revision 1.831.4.35
diff -C2 -d -r1.831.4.34 -r1.831.4.35
*** NEWS	5 Sep 2003 14:38:30 -0000	1.831.4.34
--- NEWS	5 Sep 2003 21:40:29 -0000	1.831.4.35
***************
*** 68,71 ****
--- 68,74 ----
    it duplicates Set.union_update().
  
+ - Bug #801342:  random.sample() now accepts a Set as a possible argument.
+   Previously, it insisted that the population argument be indexable.
+ 
  - Bug #778964:  random.seed() now uses fractional seconds so that
    rapid successive, seeding calls will produce different sequences.





More information about the Python-checkins mailing list