diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst index 1a2f582a31ad17..5ddba40e19f793 100644 --- a/Doc/faq/programming.rst +++ b/Doc/faq/programming.rst @@ -472,12 +472,11 @@ object ``x`` refers to). After this assignment we have two objects (the ints Some operations (for example ``y.append(10)`` and ``y.sort()``) mutate the object, whereas superficially similar operations (for example ``y = y + [10]`` -and ``sorted(y)``) create a new object. In general in Python (and in all cases -in the standard library) a method that mutates an object will return ``None`` -to help avoid getting the two types of operations confused. So if you -mistakenly write ``y.sort()`` thinking it will give you a sorted copy of ``y``, -you'll instead end up with ``None``, which will likely cause your program to -generate an easily diagnosed error. +and ``sorted(y)``) create a new object. In general in Python a method that +mutates an object will return ``None`` to help avoid getting the two types +of operations confused. So if you mistakenly write ``y.sort()`` thinking it +will give you a sorted copy of ``y``, you'll instead end up with ``None``, +which will likely cause your program to generate an easily diagnosed error. However, there is one class of operations where the same operation sometimes has different behaviors with different types: the augmented assignment diff --git a/Misc/NEWS.d/next/Documentation/2018-05-05-18-28-29.bpo-334331.E33Dg2.rst b/Misc/NEWS.d/next/Documentation/2018-05-05-18-28-29.bpo-334331.E33Dg2.rst new file mode 100644 index 00000000000000..21f4dbfbf450b4 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2018-05-05-18-28-29.bpo-334331.E33Dg2.rst @@ -0,0 +1 @@ +Removed wrong statement in programming faq.