From 881818b70e7deeddb61c98bed33eae483edf111c Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Sun, 20 Sep 2015 03:05:19 +0300 Subject: [PATCH] PEP 505: Fix typo and markup --- pep-0505.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pep-0505.txt b/pep-0505.txt index bc2988fbe..a855a07f2 100644 --- a/pep-0505.txt +++ b/pep-0505.txt @@ -88,7 +88,7 @@ an excerpt from the popular Requests package:: This particular formulation has the undesirable effect of putting the operands in an unintuitive order: the brain thinks, "use ``data`` if possible and use -``[]`` as a fallback," but the code puts the fallback _before_ the preferred +``[]`` as a fallback," but the code puts the fallback *before* the preferred value. The author of this package could have written it like this instead:: @@ -129,7 +129,7 @@ chaining:: >>> title = user_title ?? local_default_title ?? global_default_title 'Global Default Title' -The direction of associativity is important because the ``None`` coalesing +The direction of associativity is important because the ``None`` coalescing operator short circuits: if its left operand is non-null, then the right operand is not evaluated. @@ -143,6 +143,8 @@ operand is not evaluated. Null-Aware Member Access Operator --------------------------------- +:: + >>> title = 'My Title' >>> title.upper() 'MY TITLE' @@ -158,6 +160,8 @@ Null-Aware Member Access Operator Null-Aware Index Access Operator --------------------------------- +:: + >>> person = {'name': 'Mark', 'age': 32} >>> person['name'] 'Mark'