18
18
19
19
* :class:`With`: on 2.6-2.7 it uses the 3.0 format.
20
20
* :class:`arguments`: on 2.6-3.1 it uses the 3.2 format, with dedicated
21
- :class:`arg` in ``vararg`` and ``kwarg`` slots.
21
+ :class:`arg` in ``vararg`` and ``kwarg`` slots.
22
22
"""
23
23
24
24
from __future__ import absolute_import , division , print_function , unicode_literals
@@ -102,7 +102,7 @@ class arg(AST, commonloc):
102
102
A formal argument, e.g. in ``def f(x)`` or ``def f(x: T)``.
103
103
104
104
:ivar arg: (string) argument name
105
- :ivar annotation: (node ) type annotation, if any; **emitted since 3.0**
105
+ :ivar annotation: (:class:`AST` ) type annotation, if any; **emitted since 3.0**
106
106
:ivar arg_loc: location of argument name
107
107
:ivar colon_loc: location of ``:``, if any; **emitted since 3.0**
108
108
"""
@@ -114,11 +114,11 @@ class arguments(AST, beginendloc):
114
114
Function definition arguments, e.g. in ``def f(x, y=1, *z, **t)``.
115
115
116
116
:ivar args: (list of :class:`arg`) regular formal arguments
117
- :ivar defaults: (list of node ) values of default arguments
117
+ :ivar defaults: (list of :class:`AST` ) values of default arguments
118
118
:ivar vararg: (:class:`arg`) splat formal argument (if any), e.g. in ``*x``
119
- :ivar kwonlyargs: (list of :class:`arg`) keyword-only (post-*) formal arguments;
119
+ :ivar kwonlyargs: (list of :class:`arg`) keyword-only (post-\ *) formal arguments;
120
120
**emitted since 3.0**
121
- :ivar kw_defaults: (list of node ) values of default keyword-only arguments;
121
+ :ivar kw_defaults: (list of :class:`AST` ) values of default keyword-only arguments;
122
122
**emitted since 3.0**
123
123
:ivar kwarg: (:class:`arg`) keyword splat formal argument (if any), e.g. in ``**x``
124
124
:ivar star_loc: location of ``*``, if any
@@ -171,9 +171,9 @@ class comprehension(AST, commonloc):
171
171
"""
172
172
A single ``for`` list comprehension clause.
173
173
174
- :ivar target: (node ) the variable(s) bound in comprehension body
175
- :ivar iter: (node ) the expression being iterated
176
- :ivar ifs: (list of node ) the ``if`` clauses
174
+ :ivar target: (:class:`AST` ) the variable(s) bound in comprehension body
175
+ :ivar iter: (:class:`AST` ) the expression being iterated
176
+ :ivar ifs: (list of :class:`AST` ) the ``if`` clauses
177
177
:ivar for_loc: location of the ``for`` keyword
178
178
:ivar in_loc: location of the ``in`` keyword
179
179
:ivar if_locs: locations of ``if`` keywords
@@ -187,9 +187,9 @@ class ExceptHandler(excepthandler):
187
187
"""
188
188
An exception handler, e.g. ``except x as y:· z``.
189
189
190
- :ivar type: (node ) type of handled exception, if any
191
- :ivar name: (assignable node ) variable bound to exception, if any
192
- :ivar body: (list of node ) code to execute when exception is caught
190
+ :ivar type: (:class:`AST` ) type of handled exception, if any
191
+ :ivar name: (assignable :class:`AST` ) variable bound to exception, if any
192
+ :ivar body: (list of :class:`AST` ) code to execute when exception is caught
193
193
:ivar except_loc: location of ``except``
194
194
:ivar as_loc: location of ``as``, if any
195
195
:ivar colon_loc: location of ``:``
@@ -203,7 +203,7 @@ class Attribute(expr):
203
203
"""
204
204
An attribute access, e.g. ``x.y``.
205
205
206
- :ivar value: (node ) left-hand side
206
+ :ivar value: (:class:`AST` ) left-hand side
207
207
:ivar attr: (string) attribute name
208
208
"""
209
209
_fields = ('value' , 'attr' , 'ctx' )
@@ -212,17 +212,17 @@ class BinOp(expr):
212
212
"""
213
213
A binary operation, e.g. ``x + y``.
214
214
215
- :ivar left: (node ) left-hand side
215
+ :ivar left: (:class:`AST` ) left-hand side
216
216
:ivar op: (:class:`operator`) operator
217
- :ivar right: (node ) right-hand side
217
+ :ivar right: (:class:`AST` ) right-hand side
218
218
"""
219
219
_fields = ('left' , 'op' , 'right' )
220
220
class BoolOp (expr ):
221
221
"""
222
222
A boolean operation, e.g. ``x and y``.
223
223
224
224
:ivar op: (:class:`boolop`) operator
225
- :ivar values: (list of node ) operands
225
+ :ivar values: (list of :class:`AST` ) operands
226
226
:ivar op_locs: locations of operators
227
227
"""
228
228
_fields = ('op' , 'values' )
@@ -231,11 +231,11 @@ class Call(expr, beginendloc):
231
231
"""
232
232
A function call, e.g. ``f(x, y=1, *z, **t)``.
233
233
234
- :ivar func: (node ) function to call
235
- :ivar args: (list of node ) regular arguments
234
+ :ivar func: (:class:`AST` ) function to call
235
+ :ivar args: (list of :class:`AST` ) regular arguments
236
236
:ivar keywords: (list of :class:`keyword`) keyword arguments
237
- :ivar starargs: (node ) splat argument (if any), e.g. in ``*x``
238
- :ivar kwargs: (node ) keyword splat argument (if any), e.g. in ``**x``
237
+ :ivar starargs: (:class:`AST` ) splat argument (if any), e.g. in ``*x``
238
+ :ivar kwargs: (:class:`AST` ) keyword splat argument (if any), e.g. in ``**x``
239
239
:ivar star_loc: location of ``*``, if any
240
240
:ivar dstar_loc: location of ``**``, if any
241
241
"""
@@ -245,18 +245,18 @@ class Compare(expr):
245
245
"""
246
246
A comparison operation, e.g. ``x < y`` or ``x < y > z``.
247
247
248
- :ivar left: (node ) left-hand
248
+ :ivar left: (:class:`AST` ) left-hand
249
249
:ivar ops: (list of :class:`cmpop`) compare operators
250
- :ivar comparators: (list of node ) compare values
250
+ :ivar comparators: (list of :class:`AST` ) compare values
251
251
"""
252
252
_fields = ('left' , 'ops' , 'comparators' )
253
253
class Dict (expr , beginendloc ):
254
254
"""
255
255
A dictionary, e.g. ``{x: y}``.
256
256
257
- :ivar keys: (list of node ) keys
258
- :ivar values: (list of node ) values
259
- :ivar colon_locs: ``:`` locations
257
+ :ivar keys: (list of :class:`AST` ) keys
258
+ :ivar values: (list of :class:`AST` ) values
259
+ :ivar colon_locs: locations of ``:``
260
260
"""
261
261
_fields = ('keys' , 'values' )
262
262
_locs = beginendloc ._locs + ('colon_locs' ,)
@@ -266,8 +266,8 @@ class DictComp(expr, beginendloc):
266
266
267
267
**Emitted since 2.7.**
268
268
269
- :ivar key: (node ) key part of comprehension body
270
- :ivar value: (node ) value part of comprehension body
269
+ :ivar key: (:class:`AST` ) key part of comprehension body
270
+ :ivar value: (:class:`AST` ) value part of comprehension body
271
271
:ivar generators: (list of :class:`comprehension`) ``for`` clauses
272
272
:ivar colon_loc: location of ``:``
273
273
"""
@@ -279,17 +279,17 @@ class GeneratorExp(expr, beginendloc):
279
279
"""
280
280
A generator expression, e.g. ``(x for x in y)``.
281
281
282
- :ivar elt: (node ) expression body
282
+ :ivar elt: (:class:`AST` ) expression body
283
283
:ivar generators: (list of :class:`comprehension`) ``for`` clauses
284
284
"""
285
285
_fields = ('elt' , 'generators' )
286
286
class IfExp (expr ):
287
287
"""
288
288
A conditional expression, e.g. ``x if y else z``.
289
289
290
- :ivar test: (node ) condition
291
- :ivar body: (node ) value if true
292
- :ivar orelse: (node ) value if false
290
+ :ivar test: (:class:`AST` ) condition
291
+ :ivar body: (:class:`AST` ) value if true
292
+ :ivar orelse: (:class:`AST` ) value if false
293
293
:ivar if_loc: location of ``if``
294
294
:ivar else_loc: location of ``else``
295
295
"""
@@ -300,7 +300,7 @@ class Lambda(expr):
300
300
A lambda expression, e.g. ``lambda x: x*x``.
301
301
302
302
:ivar args: (:class:`arguments`) arguments
303
- :ivar body: (node ) body
303
+ :ivar body: (:class:`AST` ) body
304
304
:ivar lambda_loc: location of ``lambda``
305
305
:ivar colon_loc: location of ``:``
306
306
"""
@@ -310,14 +310,14 @@ class List(expr, beginendloc):
310
310
"""
311
311
A list, e.g. ``[x, y]``.
312
312
313
- :ivar elts: (list of node ) elements
313
+ :ivar elts: (list of :class:`AST` ) elements
314
314
"""
315
315
_fields = ('elts' , 'ctx' )
316
316
class ListComp (expr , beginendloc ):
317
317
"""
318
318
A list comprehension, e.g. ``[x for x in y]``.
319
319
320
- :ivar elt: (node ) comprehension body
320
+ :ivar elt: (:class:`AST` ) comprehension body
321
321
:ivar generators: (list of :class:`comprehension`) ``for`` clauses
322
322
"""
323
323
_fields = ('elt' , 'generators' )
@@ -348,7 +348,7 @@ class Repr(expr, beginendloc):
348
348
349
349
**Emitted until 3.0.**
350
350
351
- :ivar value: (node ) value
351
+ :ivar value: (:class:`AST` ) value
352
352
"""
353
353
_fields = ('value' ,)
354
354
class Set (expr , beginendloc ):
@@ -357,7 +357,7 @@ class Set(expr, beginendloc):
357
357
358
358
**Emitted since 2.7.**
359
359
360
- :ivar elts: (list of node ) elements
360
+ :ivar elts: (list of :class:`AST` ) elements
361
361
"""
362
362
_fields = ('elts' ,)
363
363
class SetComp (expr , beginendloc ):
@@ -366,7 +366,7 @@ class SetComp(expr, beginendloc):
366
366
367
367
**Emitted since 2.7.**
368
368
369
- :ivar elt: (node ) comprehension body
369
+ :ivar elt: (:class:`AST` ) comprehension body
370
370
:ivar generators: (list of :class:`comprehension`) ``for`` clauses
371
371
"""
372
372
_fields = ('elt' , 'generators' )
@@ -381,7 +381,7 @@ class Starred(expr):
381
381
"""
382
382
A starred expression, e.g. ``*x`` in ``*x, y = z``.
383
383
384
- :ivar value: (node ) expression
384
+ :ivar value: (:class:`AST` ) expression
385
385
:ivar star_loc: location of ``*``
386
386
"""
387
387
_fields = ('value' ,)
@@ -390,7 +390,7 @@ class Subscript(expr, beginendloc):
390
390
"""
391
391
A subscript operation, e.g. ``x[1]``.
392
392
393
- :ivar value: (node ) object being sliced
393
+ :ivar value: (:class:`AST` ) object being sliced
394
394
:ivar slice: (:class:`slice`) slice
395
395
"""
396
396
_fields = ('value' , 'slice' , 'ctx' )
@@ -406,14 +406,14 @@ class UnaryOp(expr):
406
406
An unary operation, e.g. ``+x``.
407
407
408
408
:ivar op: (:class:`unaryop`) operator
409
- :ivar operand: (node ) operand
409
+ :ivar operand: (:class:`AST` ) operand
410
410
"""
411
411
_fields = ('op' , 'operand' )
412
412
class Yield (expr ):
413
413
"""
414
414
A yield expression, e.g. ``(yield x)``.
415
415
416
- :ivar value: (node ) yielded value
416
+ :ivar value: (:class:`AST` ) yielded value
417
417
:ivar yield_loc: location of ``yield``
418
418
"""
419
419
_fields = ('value' ,)
@@ -432,7 +432,7 @@ class keyword(AST, commonloc):
432
432
A keyword actual argument, e.g. in ``f(x=1)``.
433
433
434
434
:ivar arg: (string) name
435
- :ivar value: (node ) value
435
+ :ivar value: (:class:`AST` ) value
436
436
:ivar equals_loc: location of ``=``
437
437
"""
438
438
_fields = ('arg' , 'value' )
@@ -480,26 +480,28 @@ class slice(AST, commonloc):
480
480
class ExtSlice (slice ):
481
481
"""
482
482
The multiple slice, e.g. in ``x[0:1, 2:3]``.
483
+ Note that multiple slices with only integer indexes
484
+ will appear as instances of :class:`Index`.
483
485
484
486
:ivar dims: (:class:`slice`) sub-slices
485
487
"""
486
488
_fields = ('dims' ,)
487
489
class Index (slice ):
488
490
"""
489
- The index, e.g. in ``x[1]``.
491
+ The index, e.g. in ``x[1]`` or ``x[1, 2]`` .
490
492
491
- :ivar value: (node ) index
493
+ :ivar value: (:class:`AST` ) index
492
494
"""
493
495
_fields = ('value' ,)
494
496
class Slice (slice ):
495
497
"""
496
498
The slice, e.g. in ``x[0:1]`` or ``x[0:1:2]``.
497
499
498
- :ivar lower: (node or None ) lower bound
499
- :ivar upper: (node or None ) upper bound
500
- :ivar step: (node or None ) iteration step
500
+ :ivar lower: (:class:`AST` ) lower bound, if any
501
+ :ivar upper: (:class:`AST` ) upper bound, if any
502
+ :ivar step: (:class:`AST` ) iteration step, if any
501
503
:ivar bound_colon_loc: location of first semicolon
502
- :ivar step_colon_loc: location of second semicolon
504
+ :ivar step_colon_loc: location of second semicolon, if any
503
505
"""
504
506
_fields = ('lower' , 'upper' , 'step' )
505
507
_locs = slice ._locs + ('bound_colon_loc' , 'step_colon_loc' )
@@ -510,16 +512,16 @@ class Assert(stmt, keywordloc):
510
512
"""
511
513
The ``assert x, msg`` statement.
512
514
513
- :ivar test: (node ) condition
514
- :ivar msg: (node ) message, if any
515
+ :ivar test: (:class:`AST` ) condition
516
+ :ivar msg: (:class:`AST` ) message, if any
515
517
"""
516
518
_fields = ('test' , 'msg' )
517
519
class Assign (stmt ):
518
520
"""
519
- The ``=`` statement.
521
+ The ``=`` statement, e.g. in ``x = 1`` or ``x = y = 1`` .
520
522
521
- :ivar targets: (list of assignable node ) left-hand sides
522
- :ivar value: (node ) right-hand side
523
+ :ivar targets: (list of assignable :class:`AST` ) left-hand sides
524
+ :ivar value: (:class:`AST` ) right-hand side
523
525
:ivar op_locs: location of equality signs corresponding to ``targets``
524
526
"""
525
527
_fields = ('targets' , 'value' )
@@ -528,9 +530,9 @@ class AugAssign(stmt):
528
530
"""
529
531
The operator-assignment statement, e.g. ``+=``.
530
532
531
- :ivar target: (assignable node ) left-hand side
533
+ :ivar target: (assignable :class:`AST` ) left-hand side
532
534
:ivar op: (:class`) operator
533
- :ivar value: (node ) right-hand side
535
+ :ivar value: (:class:`AST` ) right-hand side
534
536
"""
535
537
_fields = ('target' , 'op' , 'value' )
536
538
class Break (stmt , keywordloc ):
@@ -541,12 +543,12 @@ class ClassDef(stmt, keywordloc):
541
543
``class x(y, z=1, *t, **u):· v`` (3.0) statement.
542
544
543
545
:ivar name: (string) name
544
- :ivar bases: (list of node ) base classes
546
+ :ivar bases: (list of :class:`AST` ) base classes
545
547
:ivar keywords: (list of :class:`keyword`) keyword arguments; **emitted since 3.0**
546
- :ivar starargs: (node ) splat argument (if any), e.g. in ``*x``; **emitted since 3.0**
547
- :ivar kwargs: (node ) keyword splat argument (if any), e.g. in ``**x``; **emitted since 3.0**
548
- :ivar body: (list of node ) body
549
- :ivar decorator_list: (list of node ) decorators
548
+ :ivar starargs: (:class:`AST` ) splat argument (if any), e.g. in ``*x``; **emitted since 3.0**
549
+ :ivar kwargs: (:class:`AST` ) keyword splat argument (if any), e.g. in ``**x``; **emitted since 3.0**
550
+ :ivar body: (list of :class:`AST` ) body
551
+ :ivar decorator_list: (list of :class:`AST` ) decorators
550
552
:ivar keyword_loc: location of ``class``
551
553
:ivar name_loc: location of name
552
554
:ivar lparen_loc: location of ``(``, if any
@@ -574,9 +576,9 @@ class Exec(stmt, keywordloc):
574
576
575
577
**Emitted until 3.0.**
576
578
577
- :ivar body: (node ) code
578
- :ivar locals: (node ) locals
579
- :ivar globals: (node ) globals
579
+ :ivar body: (:class:`AST` ) code
580
+ :ivar locals: (:class:`AST` ) locals
581
+ :ivar globals: (:class:`AST` ) globals
580
582
:ivar keyword_loc: location of ``exec``
581
583
:ivar in_loc: location of ``in``
582
584
"""
@@ -593,10 +595,10 @@ class For(stmt, keywordloc):
593
595
"""
594
596
The ``for x in y:· z·else:· t`` statement.
595
597
596
- :ivar target: (assignable node ) loop variable
597
- :ivar iter: (node ) loop collection
598
- :ivar body: (list of node ) code for every iteration
599
- :ivar orelse: (list of node ) code if empty
598
+ :ivar target: (assignable :class:`AST` ) loop variable
599
+ :ivar iter: (:class:`AST` ) loop collection
600
+ :ivar body: (list of :class:`AST` ) code for every iteration
601
+ :ivar orelse: (list of :class:`AST` ) code if empty
600
602
:ivar keyword_loc: location of ``for``
601
603
:ivar in_loc: location of ``in``
602
604
:ivar for_colon_loc: location of colon after ``for``
@@ -607,13 +609,13 @@ class For(stmt, keywordloc):
607
609
_locs = keywordloc ._locs + ('in_loc' , 'for_colon_loc' , 'else_loc' , 'else_colon_loc' )
608
610
class FunctionDef (stmt , keywordloc ):
609
611
"""
610
- The ``def f(x):· y`` (2.6) or ``def f(x) -> t:· y`` (2.6 ) statement.
612
+ The ``def f(x):· y`` (2.6) or ``def f(x) -> t:· y`` (3.0 ) statement.
611
613
612
614
:ivar name: (string) name
613
615
:ivar args: (:class:`arguments`) formal arguments
614
- :ivar returns: (node ) return type annotation; **emitted since 3.0**
615
- :ivar body: (list of node ) body
616
- :ivar decorator_list: (list of node ) decorators
616
+ :ivar returns: (:class:`AST` ) return type annotation; **emitted since 3.0**
617
+ :ivar body: (list of :class:`AST` ) body
618
+ :ivar decorator_list: (list of :class:`AST` ) decorators
617
619
:ivar keyword_loc: location of ``def``
618
620
:ivar name_loc: location of name
619
621
:ivar arrow_loc: location of ``->``, if any; **emitted since 3.0**
@@ -635,9 +637,9 @@ class If(stmt, keywordloc):
635
637
"""
636
638
The ``if x:· y·else:· z`` or ``if x:· y·elif: z· t`` statement.
637
639
638
- :ivar test: (node ) condition
639
- :ivar body: (list of node ) code if true
640
- :ivar orelse: (list of node ) code if false
640
+ :ivar test: (:class:`AST` ) condition
641
+ :ivar body: (list of :class:`AST` ) code if true
642
+ :ivar orelse: (list of :class:`AST` ) code if false
641
643
:ivar if_colon_loc: location of colon after ``if`` or ``elif``
642
644
:ivar else_loc: location of ``else``, if any
643
645
:ivar else_colon_loc: location of colon after ``else``, if any
@@ -685,24 +687,24 @@ class Print(stmt, keywordloc):
685
687
"""
686
688
The ``print >>x, y, z,`` statement.
687
689
688
- **Emitted until 3.0 or `` print_function`` future flag.**
690
+ **Emitted until 3.0 or until print_function future flag is activated .**
689
691
690
- :ivar dest: (node ) destination stream, if any
691
- :ivar values: (list of node ) values to print
692
+ :ivar dest: (:class:`AST` ) destination stream, if any
693
+ :ivar values: (list of :class:`AST` ) values to print
692
694
:ivar nl: (boolean) whether to print newline after values
693
695
:ivar dest_loc: location of ``>>``
694
696
"""
695
697
_fields = ('dest' , 'values' , 'nl' )
696
698
_locs = keywordloc ._locs + ('dest_loc' ,)
697
699
class Raise (stmt , keywordloc ):
698
700
"""
699
- The ``raise exc, arg, traceback`` (2.x ) or
701
+ The ``raise exc, arg, traceback`` (2.6 ) or
700
702
or ``raise exc from cause`` (3.0) statement.
701
703
702
- :ivar exc: (node ) exception type or instance
703
- :ivar cause: (node ) cause of exception, if any; **emitted since 3.0**
704
- :ivar inst: (node ) exception instance or argument list, if any; **emitted until 3.0**
705
- :ivar tback: (node ) traceback, if any; **emitted until 3.0**
704
+ :ivar exc: (:class:`AST` ) exception type or instance
705
+ :ivar cause: (:class:`AST` ) cause of exception, if any; **emitted since 3.0**
706
+ :ivar inst: (:class:`AST` ) exception instance or argument list, if any; **emitted until 3.0**
707
+ :ivar tback: (:class:`AST` ) traceback, if any; **emitted until 3.0**
706
708
:ivar from_loc: location of ``from``, if any; **emitted since 3.0**
707
709
"""
708
710
_fields = ('exc' , 'cause' , 'inst' , 'tback' )
@@ -711,7 +713,7 @@ class Return(stmt, keywordloc):
711
713
"""
712
714
The ``return x`` statement.
713
715
714
- :ivar value: (node ) return value, if any
716
+ :ivar value: (:class:`AST` ) return value, if any
715
717
"""
716
718
_fields = ('value' ,)
717
719
class TryExcept (stmt , keywordloc ):
@@ -720,9 +722,9 @@ class TryExcept(stmt, keywordloc):
720
722
721
723
**Emitted until 3.0.**
722
724
723
- :ivar body: (list of node ) code to try
725
+ :ivar body: (list of :class:`AST` ) code to try
724
726
:ivar handlers: (list of :class:`ExceptHandler`) exception handlers
725
- :ivar orelse: (list of node ) code if no exception
727
+ :ivar orelse: (list of :class:`AST` ) code if no exception
726
728
:ivar keyword_loc: location of ``try``
727
729
:ivar try_colon_loc: location of ``:`` after ``try``
728
730
:ivar else_loc: location of ``else``
@@ -736,8 +738,8 @@ class TryFinally(stmt, keywordloc):
736
738
737
739
**Emitted until 3.0.**
738
740
739
- :ivar body: (list of node ) code to try
740
- :ivar finalbody: (list of node ) code to finalize
741
+ :ivar body: (list of :class:`AST` ) code to try
742
+ :ivar finalbody: (list of :class:`AST` ) code to finalize
741
743
:ivar keyword_loc: location of ``try``
742
744
:ivar try_colon_loc: location of ``:`` after ``try``
743
745
:ivar finally_loc: location of ``finally``
@@ -749,9 +751,9 @@ class While(stmt, keywordloc):
749
751
"""
750
752
The ``while x:· y·else:· z`` statement.
751
753
752
- :ivar test: (node ) condition
753
- :ivar body: (list of node ) code for every iteration
754
- :ivar orelse: (list of node ) code if empty
754
+ :ivar test: (:class:`AST` ) condition
755
+ :ivar body: (list of :class:`AST` ) code for every iteration
756
+ :ivar orelse: (list of :class:`AST` ) code if empty
755
757
:ivar keyword_loc: location of ``while``
756
758
:ivar while_colon_loc: location of colon after ``while``
757
759
:ivar else_loc: location of ``else``, if any
@@ -764,7 +766,7 @@ class With(stmt, keywordloc):
764
766
The ``with x as y:· z`` statement.
765
767
766
768
:ivar items: (list of :class:`withitem`) bindings
767
- :ivar body: (node ) body
769
+ :ivar body: (:class:`AST` ) body
768
770
:ivar keyword_loc: location of ``with``
769
771
:ivar colon_loc: location of ``:``
770
772
"""
@@ -786,8 +788,8 @@ class withitem(AST, commonloc):
786
788
"""
787
789
The ``x as y`` clause in ``with x as y:``.
788
790
789
- :ivar context_expr: (node ) context
790
- :ivar optional_vars: (assignable node ) context binding, if any
791
+ :ivar context_expr: (:class:`AST` ) context
792
+ :ivar optional_vars: (assignable :class:`AST` ) context binding, if any
791
793
:ivar as_loc: location of ``as``, if any
792
794
"""
793
795
_fields = ('context_expr' , 'optional_vars' )
0 commit comments