[New-bugs-announce] [issue6569] unittest document bug (random.shuffle sequence)

Kouki Hashimoto report at bugs.python.org
Sat Jul 25 02:47:56 CEST 2009

New submission from Kouki Hashimoto <hsmtkk at gmail.com>:

I found a bug in unittest sample code.
(naming this code as test_sample.py)

I got this error.
$ python3.2 test_sample.py
ERROR: test_shuffle (__main__.TestSequenceFunctions)
Traceback (most recent call last):
  File "test_sample.py", line 11, in test_shuffle
line 270, in shuffle
    x[i], x[j] = x[j], x[i]
TypeError: 'range' object does not support item assignment

Ran 3 tests in 0.004s

I think this code should be fixed with attached patch.

assignee: georg.brandl
components: Documentation
files: unittest.rst.patch
keywords: patch
messages: 90907
nosy: georg.brandl, hsmtkk
severity: normal
status: open
title: unittest document bug (random.shuffle sequence)
versions: Python 3.2
Added file: http://bugs.python.org/file14563/unittest.rst.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list