1
1
# -*- coding: utf-8 -*-
2
- # Autogenerated by Sphinx on Wed Dec 18 22:05:39 2019
2
+ # Autogenerated by Sphinx on Fri Jan 24 22:03:37 2020
3
3
topics = {'assert': 'The "assert" statement\n'
4
4
'**********************\n'
5
5
'\n'
470
470
'The following code:\n'
471
471
'\n'
472
472
' async for TARGET in ITER:\n'
473
- ' BLOCK \n'
473
+ ' SUITE \n'
474
474
' else:\n'
475
- ' BLOCK2 \n'
475
+ ' SUITE2 \n'
476
476
'\n'
477
477
'Is semantically equivalent to:\n'
478
478
'\n'
479
479
' iter = (ITER)\n'
480
480
' iter = type(iter).__aiter__(iter)\n'
481
481
' running = True\n'
482
+ '\n'
482
483
' while running:\n'
483
484
' try:\n'
484
485
' TARGET = await type(iter).__anext__(iter)\n'
485
486
' except StopAsyncIteration:\n'
486
487
' running = False\n'
487
488
' else:\n'
488
- ' BLOCK \n'
489
+ ' SUITE \n'
489
490
' else:\n'
490
- ' BLOCK2 \n'
491
+ ' SUITE2 \n'
491
492
'\n'
492
493
'See also "__aiter__()" and "__anext__()" for details.\n'
493
494
'\n'
507
508
'\n'
508
509
'The following code:\n'
509
510
'\n'
510
- ' async with EXPR as VAR :\n'
511
- ' BLOCK \n'
511
+ ' async with EXPRESSION as TARGET :\n'
512
+ ' SUITE \n'
512
513
'\n'
513
- 'Is semantically equivalent to:\n'
514
+ 'is semantically equivalent to:\n'
514
515
'\n'
515
- ' mgr = (EXPR)\n'
516
- ' aexit = type(mgr).__aexit__\n'
517
- ' aenter = type(mgr).__aenter__(mgr)\n'
516
+ ' manager = (EXPRESSION)\n'
517
+ ' aenter = type(manager).__aenter__\n'
518
+ ' aexit = type(manager).__aexit__\n'
519
+ ' value = await aenter(manager)\n'
520
+ ' hit_except = False\n'
518
521
'\n'
519
- ' VAR = await aenter\n'
520
522
' try:\n'
521
- ' BLOCK\n'
523
+ ' TARGET = value\n'
524
+ ' SUITE\n'
522
525
' except:\n'
523
- ' if not await aexit(mgr, *sys.exc_info()):\n'
526
+ ' hit_except = True\n'
527
+ ' if not await aexit(manager, *sys.exc_info()):\n'
524
528
' raise\n'
525
- ' else:\n'
526
- ' await aexit(mgr, None, None, None)\n'
529
+ ' finally:\n'
530
+ ' if not hit_except:\n'
531
+ ' await aexit(manager, None, None, None)\n'
527
532
'\n'
528
533
'See also "__aenter__()" and "__aexit__()" for details.\n'
529
534
'\n'
2519
2524
'"with_item")\n'
2520
2525
' is evaluated to obtain a context manager.\n'
2521
2526
'\n'
2522
- '2. The context manager’s "__exit__ ()" is loaded for later use.\n'
2527
+ '2. The context manager’s "__enter__ ()" is loaded for later use.\n'
2523
2528
'\n'
2524
- '3. The context manager’s "__enter__ ()" method is invoked .\n'
2529
+ '3. The context manager’s "__exit__ ()" is loaded for later use .\n'
2525
2530
'\n'
2526
- '4. If a target was included in the "with" statement, the return\n'
2531
+ '4. The context manager’s "__enter__()" method is invoked.\n'
2532
+ '\n'
2533
+ '5. If a target was included in the "with" statement, the return\n'
2527
2534
' value from "__enter__()" is assigned to it.\n'
2528
2535
'\n'
2529
2536
' Note: The "with" statement guarantees that if the '
2536
2543
'occurring\n'
2537
2544
' within the suite would be. See step 6 below.\n'
2538
2545
'\n'
2539
- '5 . The suite is executed.\n'
2546
+ '6 . The suite is executed.\n'
2540
2547
'\n'
2541
- '6 . The context manager’s "__exit__()" method is invoked. If an\n'
2548
+ '7 . The context manager’s "__exit__()" method is invoked. If an\n'
2542
2549
' exception caused the suite to be exited, its type, value, '
2543
2550
'and\n'
2544
2551
' traceback are passed as arguments to "__exit__()". Otherwise, '
2560
2567
'proceeds\n'
2561
2568
' at the normal location for the kind of exit that was taken.\n'
2562
2569
'\n'
2570
+ 'The following code:\n'
2571
+ '\n'
2572
+ ' with EXPRESSION as TARGET:\n'
2573
+ ' SUITE\n'
2574
+ '\n'
2575
+ 'is semantically equivalent to:\n'
2576
+ '\n'
2577
+ ' manager = (EXPRESSION)\n'
2578
+ ' enter = type(manager).__enter__\n'
2579
+ ' exit = type(manager).__exit__\n'
2580
+ ' value = enter(manager)\n'
2581
+ ' hit_except = False\n'
2582
+ '\n'
2583
+ ' try:\n'
2584
+ ' TARGET = value\n'
2585
+ ' SUITE\n'
2586
+ ' except:\n'
2587
+ ' hit_except = True\n'
2588
+ ' if not exit(manager, *sys.exc_info()):\n'
2589
+ ' raise\n'
2590
+ ' finally:\n'
2591
+ ' if not hit_except:\n'
2592
+ ' exit(manager, None, None, None)\n'
2593
+ '\n'
2563
2594
'With more than one item, the context managers are processed as '
2564
2595
'if\n'
2565
2596
'multiple "with" statements were nested:\n'
2566
2597
'\n'
2567
2598
' with A() as a, B() as b:\n'
2568
- ' suite \n'
2599
+ ' SUITE \n'
2569
2600
'\n'
2570
- 'is equivalent to\n'
2601
+ 'is semantically equivalent to: \n'
2571
2602
'\n'
2572
2603
' with A() as a:\n'
2573
2604
' with B() as b:\n'
2574
- ' suite \n'
2605
+ ' SUITE \n'
2575
2606
'\n'
2576
2607
'Changed in version 3.1: Support for multiple context '
2577
2608
'expressions.\n'
2935
2966
'The following code:\n'
2936
2967
'\n'
2937
2968
' async for TARGET in ITER:\n'
2938
- ' BLOCK \n'
2969
+ ' SUITE \n'
2939
2970
' else:\n'
2940
- ' BLOCK2 \n'
2971
+ ' SUITE2 \n'
2941
2972
'\n'
2942
2973
'Is semantically equivalent to:\n'
2943
2974
'\n'
2944
2975
' iter = (ITER)\n'
2945
2976
' iter = type(iter).__aiter__(iter)\n'
2946
2977
' running = True\n'
2978
+ '\n'
2947
2979
' while running:\n'
2948
2980
' try:\n'
2949
2981
' TARGET = await type(iter).__anext__(iter)\n'
2950
2982
' except StopAsyncIteration:\n'
2951
2983
' running = False\n'
2952
2984
' else:\n'
2953
- ' BLOCK \n'
2985
+ ' SUITE \n'
2954
2986
' else:\n'
2955
- ' BLOCK2 \n'
2987
+ ' SUITE2 \n'
2956
2988
'\n'
2957
2989
'See also "__aiter__()" and "__anext__()" for details.\n'
2958
2990
'\n'
2972
3004
'\n'
2973
3005
'The following code:\n'
2974
3006
'\n'
2975
- ' async with EXPR as VAR :\n'
2976
- ' BLOCK \n'
3007
+ ' async with EXPRESSION as TARGET :\n'
3008
+ ' SUITE \n'
2977
3009
'\n'
2978
- 'Is semantically equivalent to:\n'
3010
+ 'is semantically equivalent to:\n'
2979
3011
'\n'
2980
- ' mgr = (EXPR)\n'
2981
- ' aexit = type(mgr).__aexit__\n'
2982
- ' aenter = type(mgr).__aenter__(mgr)\n'
3012
+ ' manager = (EXPRESSION)\n'
3013
+ ' aenter = type(manager).__aenter__\n'
3014
+ ' aexit = type(manager).__aexit__\n'
3015
+ ' value = await aenter(manager)\n'
3016
+ ' hit_except = False\n'
2983
3017
'\n'
2984
- ' VAR = await aenter\n'
2985
3018
' try:\n'
2986
- ' BLOCK\n'
3019
+ ' TARGET = value\n'
3020
+ ' SUITE\n'
2987
3021
' except:\n'
2988
- ' if not await aexit(mgr, *sys.exc_info()):\n'
3022
+ ' hit_except = True\n'
3023
+ ' if not await aexit(manager, *sys.exc_info()):\n'
2989
3024
' raise\n'
2990
- ' else:\n'
2991
- ' await aexit(mgr, None, None, None)\n'
3025
+ ' finally:\n'
3026
+ ' if not hit_except:\n'
3027
+ ' await aexit(manager, None, None, None)\n'
2992
3028
'\n'
2993
3029
'See also "__aenter__()" and "__aexit__()" for details.\n'
2994
3030
'\n'
6808
6844
'object.__rfloordiv__(self, other)\n'
6809
6845
'object.__rmod__(self, other)\n'
6810
6846
'object.__rdivmod__(self, other)\n'
6811
- 'object.__rpow__(self, other)\n'
6847
+ 'object.__rpow__(self, other[, modulo] )\n'
6812
6848
'object.__rlshift__(self, other)\n'
6813
6849
'object.__rrshift__(self, other)\n'
6814
6850
'object.__rand__(self, other)\n'
9483
9519
'object.__rfloordiv__(self, other)\n'
9484
9520
'object.__rmod__(self, other)\n'
9485
9521
'object.__rdivmod__(self, other)\n'
9486
- 'object.__rpow__(self, other)\n'
9522
+ 'object.__rpow__(self, other[, modulo] )\n'
9487
9523
'object.__rlshift__(self, other)\n'
9488
9524
'object.__rrshift__(self, other)\n'
9489
9525
'object.__rand__(self, other)\n'
9874
9910
'best\n'
9875
9911
' performances, but only used at the first encoding '
9876
9912
'error. Enable the\n'
9877
- ' development mode ("-X" "dev" option), or use a debug '
9878
- 'build, to\n'
9879
- ' check *errors*.\n'
9913
+ ' Python Development Mode, or use a debug build to check '
9914
+ '*errors*.\n'
9880
9915
'\n'
9881
9916
' Changed in version 3.1: Support for keyword arguments '
9882
9917
'added.\n'
12401
12436
'dictionary. This\n'
12402
12437
' is a shortcut for "reversed(d.keys())".\n'
12403
12438
'\n'
12439
+ ' New in version 3.8.\n'
12440
+ '\n'
12404
12441
' setdefault(key[, default])\n'
12405
12442
'\n'
12406
12443
' If *key* is in the dictionary, return its value. If '
@@ -13606,11 +13643,13 @@
13606
13643
'1. The context expression (the expression given in the "with_item")\n'
13607
13644
' is evaluated to obtain a context manager.\n'
13608
13645
'\n'
13609
- '2. The context manager’s "__exit__ ()" is loaded for later use.\n'
13646
+ '2. The context manager’s "__enter__ ()" is loaded for later use.\n'
13610
13647
'\n'
13611
- '3. The context manager’s "__enter__ ()" method is invoked .\n'
13648
+ '3. The context manager’s "__exit__ ()" is loaded for later use .\n'
13612
13649
'\n'
13613
- '4. If a target was included in the "with" statement, the return\n'
13650
+ '4. The context manager’s "__enter__()" method is invoked.\n'
13651
+ '\n'
13652
+ '5. If a target was included in the "with" statement, the return\n'
13614
13653
' value from "__enter__()" is assigned to it.\n'
13615
13654
'\n'
13616
13655
' Note: The "with" statement guarantees that if the "__enter__()"\n'
13620
13659
' target list, it will be treated the same as an error occurring\n'
13621
13660
' within the suite would be. See step 6 below.\n'
13622
13661
'\n'
13623
- '5 . The suite is executed.\n'
13662
+ '6 . The suite is executed.\n'
13624
13663
'\n'
13625
- '6 . The context manager’s "__exit__()" method is invoked. If an\n'
13664
+ '7 . The context manager’s "__exit__()" method is invoked. If an\n'
13626
13665
' exception caused the suite to be exited, its type, value, and\n'
13627
13666
' traceback are passed as arguments to "__exit__()". Otherwise, '
13628
13667
'three\n'
@@ -13642,17 +13681,41 @@
13642
13681
'proceeds\n'
13643
13682
' at the normal location for the kind of exit that was taken.\n'
13644
13683
'\n'
13684
+ 'The following code:\n'
13685
+ '\n'
13686
+ ' with EXPRESSION as TARGET:\n'
13687
+ ' SUITE\n'
13688
+ '\n'
13689
+ 'is semantically equivalent to:\n'
13690
+ '\n'
13691
+ ' manager = (EXPRESSION)\n'
13692
+ ' enter = type(manager).__enter__\n'
13693
+ ' exit = type(manager).__exit__\n'
13694
+ ' value = enter(manager)\n'
13695
+ ' hit_except = False\n'
13696
+ '\n'
13697
+ ' try:\n'
13698
+ ' TARGET = value\n'
13699
+ ' SUITE\n'
13700
+ ' except:\n'
13701
+ ' hit_except = True\n'
13702
+ ' if not exit(manager, *sys.exc_info()):\n'
13703
+ ' raise\n'
13704
+ ' finally:\n'
13705
+ ' if not hit_except:\n'
13706
+ ' exit(manager, None, None, None)\n'
13707
+ '\n'
13645
13708
'With more than one item, the context managers are processed as if\n'
13646
13709
'multiple "with" statements were nested:\n'
13647
13710
'\n'
13648
13711
' with A() as a, B() as b:\n'
13649
- ' suite \n'
13712
+ ' SUITE \n'
13650
13713
'\n'
13651
- 'is equivalent to\n'
13714
+ 'is semantically equivalent to: \n'
13652
13715
'\n'
13653
13716
' with A() as a:\n'
13654
13717
' with B() as b:\n'
13655
- ' suite \n'
13718
+ ' SUITE \n'
13656
13719
'\n'
13657
13720
'Changed in version 3.1: Support for multiple context expressions.\n'
13658
13721
'\n'
0 commit comments