Skip to content

Commit 3a83001

Browse files
author
Kenneth Reitz
committed
Merge pull request realpython#223 from Julian/master
Removed a Confusing Example from the Style Article
2 parents 4248d13 + 0ea7091 commit 3a83001

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

docs/writing/style.rst

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -569,33 +569,6 @@ files for you.
569569
The ``with`` statement is better because it will ensure you always close the
570570
file, even if an exception is raised.
571571

572-
Returning Multiple Values from a Function
573-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
574-
575-
Python supports returning multiple values from a function as a comma-separated
576-
list, so you don't have to create an object or dictionary and pack multiple
577-
values in before you return
578-
579-
**Bad**:
580-
581-
.. code-block:: python
582-
583-
def math_func(a):
584-
return {'square': a ** 2, 'cube': a ** 3}
585-
586-
d = math_func(3)
587-
s = d['square']
588-
c = d['cube']
589-
590-
**Good**:
591-
592-
.. code-block:: python
593-
594-
def math_func(a):
595-
return a ** 2, a ** 3
596-
597-
square, cube = math_func(3)
598-
599572
Line Continuations
600573
~~~~~~~~~~~~~~~~~~
601574

0 commit comments

Comments
 (0)