File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -1761,10 +1761,34 @@ Pattern matching
17611761
17621762   .. versionadded :: 3.10 
17631763
1764+ Type annotations
1765+ ^^^^^^^^^^^^^^^^ 
1766+ 
1767+ .. class :: TypeIgnore(lineno, tag) 
1768+ 
1769+    A type ignore comment. ``lineno `` is the location of the ``#type ignore `` comment.
1770+    ``tag `` is the optional tag specified by the form ``#type ignore <tag> ``.
1771+ 
1772+    see :func: `ast.parse ` for more details.
1773+ 
1774+    .. doctest ::
1775+ 
1776+       >>> print (ast.dump(ast.parse(' x = 1 # type: ignore' type_comments = True ), indent = 4 ))
1777+       Module( 
1778+          body=[ 
1779+              Assign( 
1780+                  targets=[ 
1781+                      Name(id='x', ctx=Store())], 
1782+                  value=Constant(value=1))], 
1783+          type_ignores=[ 
1784+              TypeIgnore(lineno=1, tag='')]) 
1785+ 
1786+    .. versionadded :: 3.8 
1787+ 
17641788.. _ast-type-params :
17651789
17661790Type parameters
1767- ^^^^^^^^^^^^^^^ 
1791+ ~~~~~~~~~~~~~~~ 
17681792
17691793:ref: `Type parameters  <type-params >` can exist on classes, functions, and type
17701794aliases.
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments