mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Issue #23921: Standardized documentation whitespace formatting.
Original patch by James Edwards.
This commit is contained in:
parent
387235085c
commit
dba903993a
63 changed files with 445 additions and 409 deletions
|
@ -170,15 +170,15 @@ reference ``.args``. One may also instantiate an exception first before
|
|||
raising it and add any attributes to it as desired. ::
|
||||
|
||||
>>> try:
|
||||
... raise Exception('spam', 'eggs')
|
||||
... raise Exception('spam', 'eggs')
|
||||
... except Exception as inst:
|
||||
... print(type(inst)) # the exception instance
|
||||
... print(inst.args) # arguments stored in .args
|
||||
... print(inst) # __str__ allows args to be printed directly,
|
||||
... # but may be overridden in exception subclasses
|
||||
... x, y = inst.args # unpack args
|
||||
... print('x =', x)
|
||||
... print('y =', y)
|
||||
... print(type(inst)) # the exception instance
|
||||
... print(inst.args) # arguments stored in .args
|
||||
... print(inst) # __str__ allows args to be printed directly,
|
||||
... # but may be overridden in exception subclasses
|
||||
... x, y = inst.args # unpack args
|
||||
... print('x =', x)
|
||||
... print('y =', y)
|
||||
...
|
||||
<class 'Exception'>
|
||||
('spam', 'eggs')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue