From e6fb422d4563f9d018e235442c517a3bf58bfd26 Mon Sep 17 00:00:00 2001 From: Kuldeep Singh Date: Mon, 25 Jan 2016 22:28:46 +0530 Subject: [PATCH 1/2] Changed xrange to range Since xrange no longer works in python3 --- docs/writing/style.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/writing/style.rst b/docs/writing/style.rst index 111206f..cb2e030 100644 --- a/docs/writing/style.rst +++ b/docs/writing/style.rst @@ -349,7 +349,7 @@ Instead, use a list comprehension: .. code-block:: python - four_lists = [[] for __ in xrange(4)] + four_lists = [[] for __ in range(4)] Create a string from a list ~~~~~~~~~~~~~~~~~~~~~~~~~~~ From 7aca6814e24abc97ab76bb75e6dadcf58f6aad7d Mon Sep 17 00:00:00 2001 From: Kuldeep Singh Date: Mon, 25 Jan 2016 23:09:42 +0530 Subject: [PATCH 2/2] Added Note for xrange Python 3 does not have xrange(). Uses range() instead. --- docs/writing/style.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/writing/style.rst b/docs/writing/style.rst index cb2e030..042bdce 100644 --- a/docs/writing/style.rst +++ b/docs/writing/style.rst @@ -349,7 +349,9 @@ Instead, use a list comprehension: .. code-block:: python - four_lists = [[] for __ in range(4)] + four_lists = [[] for __ in xrange(4)] + +Note: Use range() instead of xrange() in Python 3 Create a string from a list ~~~~~~~~~~~~~~~~~~~~~~~~~~~