PEP 505: Fix typo and markup

This commit is contained in:
Berker Peksag 2015-09-20 03:05:19 +03:00
parent 1067ca4d29
commit 881818b70e
1 changed files with 6 additions and 2 deletions

View File

@ -88,7 +88,7 @@ an excerpt from the popular Requests package::
This particular formulation has the undesirable effect of putting the operands This particular formulation has the undesirable effect of putting the operands
in an unintuitive order: the brain thinks, "use ``data`` if possible and use 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. value.
The author of this package could have written it like this instead:: 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 >>> title = user_title ?? local_default_title ?? global_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 operator short circuits: if its left operand is non-null, then the right
operand is not evaluated. operand is not evaluated.
@ -143,6 +143,8 @@ operand is not evaluated.
Null-Aware Member Access Operator Null-Aware Member Access Operator
--------------------------------- ---------------------------------
::
>>> title = 'My Title' >>> title = 'My Title'
>>> title.upper() >>> title.upper()
'MY TITLE' 'MY TITLE'
@ -158,6 +160,8 @@ Null-Aware Member Access Operator
Null-Aware Index Access Operator Null-Aware Index Access Operator
--------------------------------- ---------------------------------
::
>>> person = {'name': 'Mark', 'age': 32} >>> person = {'name': 'Mark', 'age': 32}
>>> person['name'] >>> person['name']
'Mark' 'Mark'