Skip to content

Commit a291d76

Browse files
committed
Merge branch 'master' of github.com:quantifiedcode/python-code-patterns
2 parents b53576b + 3b3c931 commit a291d76

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docs/correctness/indentation_contains_mixed_spaces_and_tabs.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Per the PEP 8 Style Guide, all Python code should be consistently indented with
66
Example
77
-------
88

9-
The following code mixes spaces and tabs for indentation. The ``print "Hello, World!" statement is indented with a tab. The ``print "Goodybye, World!"`` statement is indented with 4 spaces.
9+
The following code mixes spaces and tabs for indentation. The ``print "Hello, World!"`` statement is indented with a tab. The ``print "Goodybye, World!"`` statement is indented with 4 spaces.
1010

1111
.. code:: python
1212

docs/correctness/dangerous_default_value_as_argument.rst renamed to docs/correctness/mutable_default_value_as_argument.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Using a dangerous default value as an argument
1+
Using a mutable default value as an argument
22
==============================================
33

44
Passing mutable lists or dictionaries as default arguments to a function can have unforeseen consequences. Usually when a programmer uses a list or dictionary as the default argument to a function, the programmer wants the program to create a new list or dictionary every time that the function is called. However, this is not what Python does. The first time that the function is called, Python creates a persistent object for the list or dictionary. Every subsequent time the function is called, Python uses that same persistent object that was created from the first call to the function.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy