From 0ea7091a30f8b3e99320696253772645b0271796 Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Mon, 3 Dec 2012 21:56:22 -0500 Subject: [PATCH] Removed tuple example from style guide. --- docs/writing/style.rst | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/docs/writing/style.rst b/docs/writing/style.rst index 2d6316e5f..55e16aa06 100644 --- a/docs/writing/style.rst +++ b/docs/writing/style.rst @@ -569,33 +569,6 @@ files for you. The ``with`` statement is better because it will ensure you always close the file, even if an exception is raised. -Returning Multiple Values from a Function -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Python supports returning multiple values from a function as a comma-separated -list, so you don't have to create an object or dictionary and pack multiple -values in before you return - -**Bad**: - -.. code-block:: python - - def math_func(a): - return {'square': a ** 2, 'cube': a ** 3} - - d = math_func(3) - s = d['square'] - c = d['cube'] - -**Good**: - -.. code-block:: python - - def math_func(a): - return a ** 2, a ** 3 - - square, cube = math_func(3) - Line Continuations ~~~~~~~~~~~~~~~~~~