File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -2512,7 +2512,7 @@ can contain any Python expression:
25122512.. code-block :: pycon 
25132513
25142514   >>> nationality = 'Spanish' 
2515-    >>> f'The {name } Inquisition!' 
2515+    >>> f'The {nationality } Inquisition!' 
25162516   'The Spanish Inquisition!' 
25172517
25182518{ `` or ``} ``, use a double bracket:
@@ -2583,11 +2583,13 @@ For example:
25832583
25842584:ref: `format specifier  <formatstrings >` following a colon (``':' ``).
25852585After the expression has been evaluated, and possibly converted to a string,
2586- the :meth: `__format__ ` method of the result is called with the format specifier,
2586+ the :meth: `! __format__
25872587or the empty string if no format specifier is given.
25882588The formatted result is then used as the final value for the replacement field.
25892589For example:
25902590
2591+ .. code-block :: pycon 
2592+ 
25912593   >>> from fractions import Fraction 
25922594   >>> f'{Fraction(1, 7):.6f}' 
25932595   '0.142857' 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments