This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: unittest document bug (random.shuffle sequence)
Type: Stage:
Components: Documentation Versions: Python 3.2
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: benjamin.peterson, georg.brandl, hsmtkk
Priority: normal Keywords: patch

Created on 2009-07-25 00:47 by hsmtkk, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
unittest.rst.patch hsmtkk, 2009-07-25 00:47 patch for py3k/Doc/library/unittest.rst
Messages (2)
msg90907 - (view) Author: Kouki Hashimoto (hsmtkk) Date: 2009-07-25 00:47
I found a bug in unittest sample code.
(naming this code as

I got this error.
$ python3.2
ERROR: test_shuffle (__main__.TestSequenceFunctions)
Traceback (most recent call last):
  File "", 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.
msg90908 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2009-07-25 01:02
Fixed in r74196.
Date User Action Args
2022-04-11 14:56:51adminsetgithub: 50818
2009-07-25 01:02:20benjamin.petersonsetstatus: open -> closed

nosy: + benjamin.peterson
messages: + msg90908

resolution: fixed
2009-07-25 00:47:55hsmtkkcreate