PEP 505: Fix typo and markup
This commit is contained in:
parent
1067ca4d29
commit
881818b70e
|
@ -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'
|
||||
|
|
Loading…
Reference in New Issue