1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
|
Python History
--------------
This file contains the release messages for previous Python releases.
As you read on you go back to the dark ages of Python's history.
======================================================================
What's New in Python 2.1 (final)?
=================================
We only changed a few things since the last release candidate, all in
Python library code:
- A bug in the locale module was fixed that affected locales which
define no grouping for numeric formatting.
- A few bugs in the weakref module's implementations of weak
dictionaries (WeakValueDictionary and WeakKeyDictionary) were fixed,
and the test suite was updated to check for these bugs.
- An old bug in the os.path.walk() function (introduced in Python
2.0!) was fixed: a non-existent file would cause an exception
instead of being ignored.
- Fixed a few bugs in the new symtable module found by Neil Norwitz's
PyChecker.
What's New in Python 2.1c2?
===========================
A flurry of small changes, and one showstopper fixed in the nick of
time made it necessary to release another release candidate. The list
here is the *complete* list of patches (except version updates):
Core
- Tim discovered a nasty bug in the dictionary code, caused by
PyDict_Next() calling dict_resize(), and the GC code's use of
PyDict_Next() violating an assumption in dict_items(). This was
fixed with considerable amounts of band-aid, but the net effect is a
saner and more robust implementation.
- Made a bunch of symbols static that were accidentally global.
Build and Ports
- The setup.py script didn't check for a new enough version of zlib
(1.1.3 is needed). Now it does.
- Changed "make clean" target to also remove shared libraries.
- Added a more general warning about the SGI Irix optimizer to README.
Library
- Fix a bug in urllib.basejoin("http://host", "../file.html") which
omitted the slash between host and file.html.
- The mailbox module's _Mailbox class contained a completely broken
and undocumented seek() method. Ripped it out.
- Fixed a bunch of typos in various library modules (urllib2, smtpd,
sgmllib, netrc, chunk) found by Neil Norwitz's PyChecker.
- Fixed a few last-minute bugs in unittest.
Extensions
- Reverted the patch to the OpenSSL code in socketmodule.c to support
RAND_status() and the EGD, and the subsequent patch that tried to
fix it for pre-0.9.5 versions; the problem with the patch is that on
some systems it issues a warning whenever socket is imported, and
that's unacceptable.
Tests
- Fixed the pickle tests to work with "import test.test_pickle".
- Tweaked test_locale.py to actually run the test Windows.
- In distutils/archive_util.py, call zipfile.ZipFile() with mode "w",
not "wb" (which is not a valid mode at all).
- Fix pstats browser crashes. Import readline if it exists to make
the user interface nicer.
- Add "import thread" to the top of test modules that import the
threading module (test_asynchat and test_threadedtempfile). This
prevents test failures caused by a broken threading module resulting
from a previously caught failed import.
- Changed test_asynchat.py to set the SO_REUSEADDR option; this was
needed on some platforms (e.g. Solaris 8) when the tests are run
twice in succession.
- Skip rather than fail test_sunaudiodev if no audio device is found.
What's New in Python 2.1c1?
===========================
This list was significantly updated when 2.1c2 was released; the 2.1c1
release didn't mention most changes that were actually part of 2.1c1:
Legal
- Copyright was assigned to the Python Software Foundation (PSF) and a
PSF license (very similar to the CNRI license) was added.
- The CNRI copyright notice was updated to include 2001.
Core
- After a public outcry, assignment to __debug__ is no longer illegal;
instead, a warning is issued. It will become illegal in 2.2.
- Fixed a core dump with "%#x" % 0, and changed the semantics so that
"%#x" now always prepends "0x", even if the value is zero.
- Fixed some nits in the bytecode compiler.
- Fixed core dumps when calling certain kinds of non-functions.
- Fixed various core dumps caused by reference count bugs.
Build and Ports
- Use INSTALL_SCRIPT to install script files.
- New port: SCO Unixware 7, by Billy G. Allie.
- Updated RISCOS port.
- Updated BeOS port and notes.
- Various other porting problems resolved.
Library
- The TERMIOS and SOCKET modules are now truly obsolete and
unnecessary. Their symbols are incorporated in the termios and
socket modules.
- Fixed some 64-bit bugs in pickle, cPickle, and struct, and added
better tests for pickling.
- threading: make Condition.wait() robust against KeyboardInterrupt.
- zipfile: add support to zipfile to support opening an archive
represented by an open file rather than a file name. Fix bug where
the archive was not properly closed. Fixed a bug in this bugfix
where flush() was called for a read-only file.
- imputil: added an uninstall() method to the ImportManager.
- Canvas: fixed bugs in lower() and tkraise() methods.
- SocketServer: API change (added overridable close_request() method)
so that the TCP server can explicitly close the request.
- pstats: Eric Raymond added a simple interactive statistics browser,
invoked when the module is run as a script.
- locale: fixed a problem in format().
- webbrowser: made it work when the BROWSER environment variable has a
value like "/usr/bin/netscape". Made it auto-detect Konqueror for
KDE 2. Fixed some other nits.
- unittest: changes to allow using a different exception than
AssertionError, and added a few more function aliases. Some other
small changes.
- urllib, urllib2: fixed redirect problems and a coupleof other nits.
- asynchat: fixed a critical bug in asynchat that slipped through the
2.1b2 release. Fixed another rare bug.
- Fix some unqualified except: clauses (always a bad code example).
XML
- pyexpat: new API get_version_string().
- Fixed some minidom bugs.
Extensions
- Fixed a core dump in _weakref. Removed the weakref.mapping()
function (it adds nothing to the API).
- Rationalized the use of header files in the readline module, to make
it compile (albeit with some warnings) with the very recent readline
4.2, without breaking for earlier versions.
- Hopefully fixed a buffering problem in linuxaudiodev.
- Attempted a fix to make the OpenSSL support in the socket module
work again with pre-0.9.5 versions of OpenSSL.
Tests
- Added a test case for asynchat and asyncore.
- Removed coupling between tests where one test failing could break
another.
Tools
- Ping added an interactive help browser to pydoc, fixed some nits
in the rest of the pydoc code, and added some features to his
inspect module.
- An updated python-mode.el version 4.1 which integrates Ken
Manheimer's pdbtrack.el. This makes debugging Python code via pdb
much nicer in XEmacs and Emacs. When stepping through your program
with pdb, in either the shell window or the *Python* window, the
source file and line will be tracked by an arrow. Very cool!
- IDLE: syntax warnings in interactive mode are changed into errors.
- Some improvements to Tools/webchecker (ignore some more URL types,
follow some more links).
- Brought the Tools/compiler package up to date.
What's New in Python 2.1 beta 2?
================================
(Unlisted are many fixed bugs, more documentation, etc.)
Core language, builtins, and interpreter
- The nested scopes work (enabled by "from __future__ import
nested_scopes") is completed; in particular, the future now extends
into code executed through exec, eval() and execfile(), and into the
interactive interpreter.
- When calling a base class method (e.g. BaseClass.__init__(self)),
this is now allowed even if self is not strictly spoken a class
instance (e.g. when using metaclasses or the Don Beaudry hook).
- Slice objects are now comparable but not hashable; this prevents
dict[:] from being accepted but meaningless.
- Complex division is now calculated using less braindead algorithms.
This doesn't change semantics except it's more likely to give useful
results in extreme cases. Complex repr() now uses full precision
like float repr().
- sgmllib.py now calls handle_decl() for simple <!...> declarations.
- It is illegal to assign to the name __debug__, which is set when the
interpreter starts. It is effectively a compile-time constant.
- A warning will be issued if a global statement for a variable
follows a use or assignment of that variable.
Standard library
- unittest.py, a unit testing framework by Steve Purcell (PyUNIT,
inspired by JUnit), is now part of the standard library. You now
have a choice of two testing frameworks: unittest requires you to
write testcases as separate code, doctest gathers them from
docstrings. Both approaches have their advantages and
disadvantages.
- A new module Tix was added, which wraps the Tix extension library
for Tk. With that module, it is not necessary to statically link
Tix with _tkinter, since Tix will be loaded with Tcl's "package
require" command. See Demo/tix/.
- tzparse.py is now obsolete.
- In gzip.py, the seek() and tell() methods are removed -- they were
non-functional anyway, and it's better if callers can test for their
existence with hasattr().
Python/C API
- PyDict_Next(): it is now safe to call PyDict_SetItem() with a key
that's already in the dictionary during a PyDict_Next() iteration.
This used to fail occasionally when a dictionary resize operation
could be triggered that would rehash all the keys. All other
modifications to the dictionary are still off-limits during a
PyDict_Next() iteration!
- New extended APIs related to passing compiler variables around.
- New abstract APIs PyObject_IsInstance(), PyObject_IsSubclass()
implement isinstance() and issubclass().
- Py_BuildValue() now has a "D" conversion to create a Python complex
number from a Py_complex C value.
- Extensions types which support weak references must now set the
field allocated for the weak reference machinery to NULL themselves;
this is done to avoid the cost of checking each object for having a
weakly referencable type in PyObject_INIT(), since most types are
not weakly referencable.
- PyFrame_FastToLocals() and PyFrame_LocalsToFast() copy bindings for
free variables and cell variables to and from the frame's f_locals.
- Variants of several functions defined in pythonrun.h have been added
to support the nested_scopes future statement. The variants all end
in Flags and take an extra argument, a PyCompilerFlags *; examples:
PyRun_AnyFileExFlags(), PyRun_InteractiveLoopFlags(). These
variants may be removed in Python 2.2, when nested scopes are
mandatory.
Distutils
- the sdist command now writes a PKG-INFO file, as described in PEP 241,
into the release tree.
- several enhancements to the bdist_wininst command from Thomas Heller
(an uninstaller, more customization of the installer's display)
- from Jack Jansen: added Mac-specific code to generate a dialog for
users to specify the command-line (because providing a command-line with
MacPython is awkward). Jack also made various fixes for the Mac
and the Metrowerks compiler.
- added 'platforms' and 'keywords' to the set of metadata that can be
specified for a distribution.
- applied patches from Jason Tishler to make the compiler class work with
Cygwin.
What's New in Python 2.1 beta 1?
================================
Core language, builtins, and interpreter
- Following an outcry from the community about the amount of code
broken by the nested scopes feature introduced in 2.1a2, we decided
to make this feature optional, and to wait until Python 2.2 (or at
least 6 months) to make it standard. The option can be enabled on a
per-module basis by adding "from __future__ import nested_scopes" at
the beginning of a module (before any other statements, but after
comments and an optional docstring). See PEP 236 (Back to the
__future__) for a description of the __future__ statement. PEP 227
(Statically Nested Scopes) has been updated to reflect this change,
and to clarify the semantics in a number of endcases.
- The nested scopes code, when enabled, has been hardened, and most
bugs and memory leaks in it have been fixed.
- Compile-time warnings are now generated for a number of conditions
that will break or change in meaning when nested scopes are enabled:
- Using "from...import *" or "exec" without in-clause in a function
scope that also defines a lambda or nested function with one or
more free (non-local) variables. The presence of the import* or
bare exec makes it impossible for the compiler to determine the
exact set of local variables in the outer scope, which makes it
impossible to determine the bindings for free variables in the
inner scope. To avoid the warning about import *, change it into
an import of explicitly name object, or move the import* statement
to the global scope; to avoid the warning about bare exec, use
exec...in... (a good idea anyway -- there's a possibility that
bare exec will be deprecated in the future).
- Use of a global variable in a nested scope with the same name as a
local variable in a surrounding scope. This will change in
meaning with nested scopes: the name in the inner scope will
reference the variable in the outer scope rather than the global
of the same name. To avoid the warning, either rename the outer
variable, or use a global statement in the inner function.
- An optional object allocator has been included. This allocator is
optimized for Python objects and should be faster and use less memory
than the standard system allocator. It is not enabled by default
because of possible thread safety problems. The allocator is only
protected by the Python interpreter lock and it is possible that some
extension modules require a thread safe allocator. The object
allocator can be enabled by providing the "--with-pymalloc" option to
configure.
Standard library
- pyexpat now detects the expat version if expat.h defines it. A
number of additional handlers are provided, which are only available
since expat 1.95. In addition, the methods SetParamEntityParsing and
GetInputContext of Parser objects are available with 1.95.x
only. Parser objects now provide the ordered_attributes and
specified_attributes attributes. A new module expat.model was added,
which offers a number of additional constants if 1.95.x is used.
- xml.dom offers the new functions registerDOMImplementation and
getDOMImplementation.
- xml.dom.minidom offers a toprettyxml method. A number of DOM
conformance issues have been resolved. In particular, Element now
has an hasAttributes method, and the handling of namespaces was
improved.
- Ka-Ping Yee contributed two new modules: inspect.py, a module for
getting information about live Python code, and pydoc.py, a module
for interactively converting docstrings to HTML or text.
Tools/scripts/pydoc, which is now automatically installed into
<prefix>/bin, uses pydoc.py to display documentation; try running
"pydoc -h" for instructions. "pydoc -g" pops up a small GUI that
lets you browse the module docstrings using a web browser.
- New library module difflib.py, primarily packaging the SequenceMatcher
class at the heart of the popular ndiff.py file-comparison tool.
- doctest.py (a framework for verifying Python code examples in docstrings)
is now part of the std library.
Windows changes
- A new entry in the Start menu, "Module Docs", runs "pydoc -g" -- a
small GUI that lets you browse the module docstrings using your
default web browser.
- Import is now case-sensitive. PEP 235 (Import on Case-Insensitive
Platforms) is implemented. See
http://python.sourceforge.net/peps/pep-0235.html
for full details, especially the "Current Lower-Left Semantics" section.
The new Windows import rules are simpler than before:
A. If the PYTHONCASEOK environment variable exists, same as
before: silently accept the first case-insensitive match of any
kind; raise ImportError if none found.
B. Else search sys.path for the first case-sensitive match; raise
ImportError if none found.
The same rules have been implemented on other platforms with case-
insensitive but case-preserving filesystems too (including Cygwin, and
several flavors of Macintosh operating systems).
- winsound module: Under Win9x, winsound.Beep() now attempts to simulate
what it's supposed to do (and does do under NT and 2000) via direct
port manipulation. It's unknown whether this will work on all systems,
but it does work on my Win98SE systems now and was known to be useless on
all Win9x systems before.
- Build: Subproject _test (effectively) renamed to _testcapi.
New platforms
- 2.1 should compile and run out of the box under MacOS X, even using HFS+.
Thanks to Steven Majewski!
- 2.1 should compile and run out of the box on Cygwin. Thanks to Jason
Tishler!
- 2.1 contains new files and patches for RISCOS, thanks to Dietmar
Schwertberger! See RISCOS/README for more information -- it seems
that because of the bizarre filename conventions on RISCOS, no port
to that platform is easy.
What's New in Python 2.1 alpha 2?
=================================
Core language, builtins, and interpreter
- Scopes nest. If a name is used in a function or class, but is not
local, the definition in the nearest enclosing function scope will
be used. One consequence of this change is that lambda statements
could reference variables in the namespaces where the lambda is
defined. In some unusual cases, this change will break code.
In all previous version of Python, names were resolved in exactly
three namespaces -- the local namespace, the global namespace, and
the builtin namespace. According to this old definition, if a
function A is defined within a function B, the names bound in B are
not visible in A. The new rules make names bound in B visible in A,
unless A contains a name binding that hides the binding in B.
Section 4.1 of the reference manual describes the new scoping rules
in detail. The test script in Lib/test/test_scope.py demonstrates
some of the effects of the change.
The new rules will cause existing code to break if it defines nested
functions where an outer function has local variables with the same
name as globals or builtins used by the inner function. Example:
def munge(str):
def helper(x):
return str(x)
if type(str) != type(''):
str = helper(str)
return str.strip()
Under the old rules, the name str in helper() is bound to the
builtin function str(). Under the new rules, it will be bound to
the argument named str and an error will occur when helper() is
called.
- The compiler will report a SyntaxError if "from ... import *" occurs
in a function or class scope. The language reference has documented
that this case is illegal, but the compiler never checked for it.
The recent introduction of nested scope makes the meaning of this
form of name binding ambiguous. In a future release, the compiler
may allow this form when there is no possibility of ambiguity.
- repr(string) is easier to read, now using hex escapes instead of octal,
and using \t, \n and \r instead of \011, \012 and \015 (respectively):
>>> "\texample \r\n" + chr(0) + chr(255)
'\texample \r\n\x00\xff' # in 2.1
'\011example \015\012\000\377' # in 2.0
- Functions are now compared and hashed by identity, not by value, since
the func_code attribute is writable.
- Weak references (PEP 205) have been added. This involves a few
changes in the core, an extension module (_weakref), and a Python
module (weakref). The weakref module is the public interface. It
includes support for "explicit" weak references, proxy objects, and
mappings with weakly held values.
- A 'continue' statement can now appear in a try block within the body
of a loop. It is still not possible to use continue in a finally
clause.
Standard library
- mailbox.py now has a new class, PortableUnixMailbox which is
identical to UnixMailbox but uses a more portable scheme for
determining From_ separators. Also, the constructors for all the
classes in this module have a new optional `factory' argument, which
is a callable used when new message classes must be instantiated by
the next() method.
- random.py is now self-contained, and offers all the functionality of
the now-deprecated whrandom.py. See the docs for details. random.py
also supports new functions getstate() and setstate(), for saving
and restoring the internal state of the generator; and jumpahead(n),
for quickly forcing the internal state to be the same as if n calls to
random() had been made. The latter is particularly useful for multi-
threaded programs, creating one instance of the random.Random() class for
each thread, then using .jumpahead() to force each instance to use a
non-overlapping segment of the full period.
- random.py's seed() function is new. For bit-for-bit compatibility with
prior releases, use the whseed function instead. The new seed function
addresses two problems: (1) The old function couldn't produce more than
about 2**24 distinct internal states; the new one about 2**45 (the best
that can be done in the Wichmann-Hill generator). (2) The old function
sometimes produced identical internal states when passed distinct
integers, and there was no simple way to predict when that would happen;
the new one guarantees to produce distinct internal states for all
arguments in [0, 27814431486576L).
- The socket module now supports raw packets on Linux. The socket
family is AF_PACKET.
- test_capi.py is a start at running tests of the Python C API. The tests
are implemented by the new Modules/_testmodule.c.
- A new extension module, _symtable, provides provisional access to the
internal symbol table used by the Python compiler. A higher-level
interface will be added on top of _symtable in a future release.
- Removed the obsolete soundex module.
- xml.dom.minidom now uses the standard DOM exceptions. Node supports
the isSameNode method; NamedNodeMap the get method.
- xml.sax.expatreader supports the lexical handler property; it
generates comment, startCDATA, and endCDATA events.
Windows changes
- Build procedure: the zlib project is built in a different way that
ensures the zlib header files used can no longer get out of synch with
the zlib binary used. See PCbuild\readme.txt for details. Your old
zlib-related directories can be deleted; you'll need to download fresh
source for zlib and unpack it into a new directory.
- Build: New subproject _test for the benefit of test_capi.py (see above).
- Build: New subproject _symtable, for new DLL _symtable.pyd (a nascent
interface to some Python compiler internals).
- Build: Subproject ucnhash is gone, since the code was folded into the
unicodedata subproject.
What's New in Python 2.1 alpha 1?
=================================
Core language, builtins, and interpreter
- There is a new Unicode companion to the PyObject_Str() API
called PyObject_Unicode(). It behaves in the same way as the
former, but assures that the returned value is an Unicode object
(applying the usual coercion if necessary).
- The comparison operators support "rich comparison overloading" (PEP
207). C extension types can provide a rich comparison function in
the new tp_richcompare slot in the type object. The cmp() function
and the C function PyObject_Compare() first try the new rich
comparison operators before trying the old 3-way comparison. There
is also a new C API PyObject_RichCompare() (which also falls back on
the old 3-way comparison, but does not constrain the outcome of the
rich comparison to a Boolean result).
The rich comparison function takes two objects (at least one of
which is guaranteed to have the type that provided the function) and
an integer indicating the opcode, which can be Py_LT, Py_LE, Py_EQ,
Py_NE, Py_GT, Py_GE (for <, <=, ==, !=, >, >=), and returns a Python
object, which may be NotImplemented (in which case the tp_compare
slot function is used as a fallback, if defined).
Classes can overload individual comparison operators by defining one
or more of the methods__lt__, __le__, __eq__, __ne__, __gt__,
__ge__. There are no explicit "reflected argument" versions of
these; instead, __lt__ and __gt__ are each other's reflection,
likewise for__le__ and __ge__; __eq__ and __ne__ are their own
reflection (similar at the C level). No other implications are
made; in particular, Python does not assume that == is the Boolean
inverse of !=, or that < is the Boolean inverse of >=. This makes
it possible to define types with partial orderings.
Classes or types that want to implement (in)equality tests but not
the ordering operators (i.e. unordered types) should implement ==
and !=, and raise an error for the ordering operators.
It is possible to define types whose rich comparison results are not
Boolean; e.g. a matrix type might want to return a matrix of bits
for A < B, giving elementwise comparisons. Such types should ensure
that any interpretation of their value in a Boolean context raises
an exception, e.g. by defining __nonzero__ (or the tp_nonzero slot
at the C level) to always raise an exception.
- Complex numbers use rich comparisons to define == and != but raise
an exception for <, <=, > and >=. Unfortunately, this also means
that cmp() of two complex numbers raises an exception when the two
numbers differ. Since it is not mathematically meaningful to compare
complex numbers except for equality, I hope that this doesn't break
too much code.
- The outcome of comparing non-numeric objects of different types is
not defined by the language, other than that it's arbitrary but
consistent (see the Reference Manual). An implementation detail changed
in 2.1a1 such that None now compares less than any other object. Code
relying on this new behavior (like code that relied on the previous
behavior) does so at its own risk.
- Functions and methods now support getting and setting arbitrarily
named attributes (PEP 232). Functions have a new __dict__
(a.k.a. func_dict) which hold the function attributes. Methods get
and set attributes on their underlying im_func. It is a TypeError
to set an attribute on a bound method.
- The xrange() object implementation has been improved so that
xrange(sys.maxint) can be used on 64-bit platforms. There's still a
limitation that in this case len(xrange(sys.maxint)) can't be
calculated, but the common idiom "for i in xrange(sys.maxint)" will
work fine as long as the index i doesn't actually reach 2**31.
(Python uses regular ints for sequence and string indices; fixing
that is much more work.)
- Two changes to from...import:
1) "from M import X" now works even if (after loading module M)
sys.modules['M'] is not a real module; it's basically a getattr()
operation with AttributeError exceptions changed into ImportError.
2) "from M import *" now looks for M.__all__ to decide which names to
import; if M.__all__ doesn't exist, it uses M.__dict__.keys() but
filters out names starting with '_' as before. Whether or not
__all__ exists, there's no restriction on the type of M.
- File objects have a new method, xreadlines(). This is the fastest
way to iterate over all lines in a file:
for line in file.xreadlines():
...do something to line...
See the xreadlines module (mentioned below) for how to do this for
other file-like objects.
- Even if you don't use file.xreadlines(), you may expect a speedup on
line-by-line input. The file.readline() method has been optimized
quite a bit in platform-specific ways: on systems (like Linux) that
support flockfile(), getc_unlocked(), and funlockfile(), those are
used by default. On systems (like Windows) without getc_unlocked(),
a complicated (but still thread-safe) method using fgets() is used by
default.
You can force use of the fgets() method by #define'ing
USE_FGETS_IN_GETLINE at build time (it may be faster than
getc_unlocked()).
You can force fgets() not to be used by #define'ing
DONT_USE_FGETS_IN_GETLINE (this is the first thing to try if std test
test_bufio.py fails -- and let us know if it does!).
- In addition, the fileinput module, while still slower than the other
methods on most platforms, has been sped up too, by using
file.readlines(sizehint).
- Support for run-time warnings has been added, including a new
command line option (-W) to specify the disposition of warnings.
See the description of the warnings module below.
- Extensive changes have been made to the coercion code. This mostly
affects extension modules (which can now implement mixed-type
numerical operators without having to use coercion), but
occasionally, in boundary cases the coercion semantics have changed
subtly. Since this was a terrible gray area of the language, this
is considered an improvement. Also note that __rcmp__ is no longer
supported -- instead of calling __rcmp__, __cmp__ is called with
reflected arguments.
- In connection with the coercion changes, a new built-in singleton
object, NotImplemented is defined. This can be returned for
operations that wish to indicate they are not implemented for a
particular combination of arguments. From C, this is
Py_NotImplemented.
- The interpreter accepts now bytecode files on the command line even
if they do not have a .pyc or .pyo extension. On Linux, after executing
import imp,sys,string
magic = string.join(["\\x%.2x" % ord(c) for c in imp.get_magic()],"")
reg = ':pyc:M::%s::%s:' % (magic, sys.executable)
open("/proc/sys/fs/binfmt_misc/register","wb").write(reg)
any byte code file can be used as an executable (i.e. as an argument
to execve(2)).
- %[xXo] formats of negative Python longs now produce a sign
character. In 1.6 and earlier, they never produced a sign,
and raised an error if the value of the long was too large
to fit in a Python int. In 2.0, they produced a sign if and
only if too large to fit in an int. This was inconsistent
across platforms (because the size of an int varies across
platforms), and inconsistent with hex() and oct(). Example:
>>> "%x" % -0x42L
'-42' # in 2.1
'ffffffbe' # in 2.0 and before, on 32-bit machines
>>> hex(-0x42L)
'-0x42L' # in all versions of Python
The behavior of %d formats for negative Python longs remains
the same as in 2.0 (although in 1.6 and before, they raised
an error if the long didn't fit in a Python int).
%u formats don't make sense for Python longs, but are allowed
and treated the same as %d in 2.1. In 2.0, a negative long
formatted via %u produced a sign if and only if too large to
fit in an int. In 1.6 and earlier, a negative long formatted
via %u raised an error if it was too big to fit in an int.
- Dictionary objects have an odd new method, popitem(). This removes
an arbitrary item from the dictionary and returns it (in the form of
a (key, value) pair). This can be useful for algorithms that use a
dictionary as a bag of "to do" items and repeatedly need to pick one
item. Such algorithms normally end up running in quadratic time;
using popitem() they can usually be made to run in linear time.
Standard library
- In the time module, the time argument to the functions strftime,
localtime, gmtime, asctime and ctime is now optional, defaulting to
the current time (in the local timezone).
- The ftplib module now defaults to passive mode, which is deemed a
more useful default given that clients are often inside firewalls
these days. Note that this could break if ftplib is used to connect
to a *server* that is inside a firewall, from outside; this is
expected to be a very rare situation. To fix that, you can call
ftp.set_pasv(0).
- The module site now treats .pth files not only for path configuration,
but also supports extensions to the initialization code: Lines starting
with import are executed.
- There's a new module, warnings, which implements a mechanism for
issuing and filtering warnings. There are some new built-in
exceptions that serve as warning categories, and a new command line
option, -W, to control warnings (e.g. -Wi ignores all warnings, -We
turns warnings into errors). warnings.warn(message[, category])
issues a warning message; this can also be called from C as
PyErr_Warn(category, message).
- A new module xreadlines was added. This exports a single factory
function, xreadlines(). The intention is that this code is the
absolutely fastest way to iterate over all lines in an open
file(-like) object:
import xreadlines
for line in xreadlines.xreadlines(file):
...do something to line...
This is equivalent to the previous the speed record holder using
file.readlines(sizehint). Note that if file is a real file object
(as opposed to a file-like object), this is equivalent:
for line in file.xreadlines():
...do something to line...
- The bisect module has new functions bisect_left, insort_left,
bisect_right and insort_right. The old names bisect and insort
are now aliases for bisect_right and insort_right. XXX_right
and XXX_left methods differ in what happens when the new element
compares equal to one or more elements already in the list: the
XXX_left methods insert to the left, the XXX_right methods to the
right. Code that doesn't care where equal elements end up should
continue to use the old, short names ("bisect" and "insort").
- The new curses.panel module wraps the panel library that forms part
of SYSV curses and ncurses. Contributed by Thomas Gellekum.
- The SocketServer module now sets the allow_reuse_address flag by
default in the TCPServer class.
- A new function, sys._getframe(), returns the stack frame pointer of
the caller. This is intended only as a building block for
higher-level mechanisms such as string interpolation.
- The pyexpat module supports a number of new handlers, which are
available only in expat 1.2. If invocation of a callback fails, it
will report an additional frame in the traceback. Parser objects
participate now in garbage collection. If expat reports an unknown
encoding, pyexpat will try to use a Python codec; that works only
for single-byte charsets. The parser type objects is exposed as
XMLParserObject.
- xml.dom now offers standard definitions for symbolic node type and
exception code constants, and a hierarchy of DOM exceptions. minidom
was adjusted to use them.
- The conformance of xml.dom.minidom to the DOM specification was
improved. It detects a number of additional error cases; the
previous/next relationship works even when the tree is modified;
Node supports the normalize() method; NamedNodeMap, DocumentType and
DOMImplementation classes were added; Element supports the
hasAttribute and hasAttributeNS methods; and Text supports the splitText
method.
Build issues
- For Unix (and Unix-compatible) builds, configuration and building of
extension modules is now greatly automated. Rather than having to
edit the Modules/Setup file to indicate which modules should be
built and where their include files and libraries are, a
distutils-based setup.py script now takes care of building most
extension modules. All extension modules built this way are built
as shared libraries. Only a few modules that must be linked
statically are still listed in the Setup file; you won't need to
edit their configuration.
- Python should now build out of the box on Cygwin. If it doesn't,
mail to Jason Tishler (jlt63 at users.sourceforge.net).
- Python now always uses its own (renamed) implementation of getopt()
-- there's too much variation among C library getopt()
implementations.
- C++ compilers are better supported; the CXX macro is always set to a
C++ compiler if one is found.
Windows changes
- select module: By default under Windows, a select() call
can specify no more than 64 sockets. Python now boosts
this Microsoft default to 512. If you need even more than
that, see the MS docs (you'll need to #define FD_SETSIZE
and recompile Python from source).
- Support for Windows 3.1, DOS and OS/2 is gone. The Lib/dos-8x3
subdirectory is no more!
What's New in Python 2.0?
=========================
Below is a list of all relevant changes since release 1.6. Older
changes are in the file HISTORY. If you are making the jump directly
from Python 1.5.2 to 2.0, make sure to read the section for 1.6 in the
HISTORY file! Many important changes listed there.
Alternatively, a good overview of the changes between 1.5.2 and 2.0 is
the document "What's New in Python 2.0" by Kuchling and Moshe Zadka:
http://starship.python.net/crew/amk/python/writing/new-python/.
--Guido van Rossum (home page: http://www.pythonlabs.com/~guido/)
======================================================================
What's new in 2.0 (since release candidate 1)?
==============================================
Standard library
- The copy_reg module was modified to clarify its intended use: to
register pickle support for extension types, not for classes.
pickle() will raise a TypeError if it is passed a class.
- Fixed a bug in gettext's "normalize and expand" code that prevented
it from finding an existing .mo file.
- Restored support for HTTP/0.9 servers in httplib.
- The math module was changed to stop raising OverflowError in case of
underflow, and return 0 instead in underflow cases. Whether Python
used to raise OverflowError in case of underflow was platform-
dependent (it did when the platform math library set errno to ERANGE
on underflow).
- Fixed a bug in StringIO that occurred when the file position was not
at the end of the file and write() was called with enough data to
extend past the end of the file.
- Fixed a bug that caused Tkinter error messages to get lost on
Windows. The bug was fixed by replacing direct use of
interp->result with Tcl_GetStringResult(interp).
- Fixed bug in urllib2 that caused it to fail when it received an HTTP
redirect response.
- Several changes were made to distutils: Some debugging code was
removed from util. Fixed the installer used when an external zip
program (like WinZip) is not found; the source code for this
installer is in Misc/distutils. check_lib() was modified to behave
more like AC_CHECK_LIB by add other_libraries() as a parameter. The
test for whether installed modules are on sys.path was changed to
use both normcase() and normpath().
- Several minor bugs were fixed in the xml package (the minidom,
pulldom, expatreader, and saxutils modules).
- The regression test driver (regrtest.py) behavior when invoked with
-l changed: It now reports a count of objects that are recognized as
garbage but not freed by the garbage collector.
- The regression test for the math module was changed to test
exceptional behavior when the test is run in verbose mode. Python
cannot yet guarantee consistent exception behavior across platforms,
so the exception part of test_math is run only in verbose mode, and
may fail on your platform.
Internals
- PyOS_CheckStack() has been disabled on Win64, where it caused
test_sre to fail.
Build issues
- Changed compiler flags, so that gcc is always invoked with -Wall and
-Wstrict-prototypes. Users compiling Python with GCC should see
exactly one warning, except if they have passed configure the
--with-pydebug flag. The expected warning is for getopt() in
Modules/main.c. This warning will be fixed for Python 2.1.
- Fixed configure to add -threads argument during linking on OSF1.
Tools and other miscellany
- The compiler in Tools/compiler was updated to support the new
language features introduced in 2.0: extended print statement, list
comprehensions, and augmented assignments. The new compiler should
also be backwards compatible with Python 1.5.2; the compiler will
always generate code for the version of the interpreter it runs
under.
What's new in 2.0 release candidate 1 (since beta 2)?
=====================================================
What is release candidate 1?
We believe that release candidate 1 will fix all known bugs that we
intend to fix for the 2.0 final release. This release should be a bit
more stable than the previous betas. We would like to see even more
widespread testing before the final release, so we are producing this
release candidate. The final release will be exactly the same unless
any show-stopping (or brown bag) bugs are found by testers of the
release candidate.
All the changes since the last beta release are bug fixes or changes
to support building Python for specific platforms.
Core language, builtins, and interpreter
- A bug that caused crashes when __coerce__ was used with augmented
assignment, e.g. +=, was fixed.
- Raise ZeroDivisionError when raising zero to a negative number,
e.g. 0.0 ** -2.0. Note that math.pow is unrelated to the builtin
power operator and the result of math.pow(0.0, -2.0) will vary by
platform. On Linux, it raises a ValueError.
- A bug in Unicode string interpolation was fixed that occasionally
caused errors with formats including "%%". For example, the
following expression "%% %s" % u"abc" no longer raises a TypeError.
- Compilation of deeply nested expressions raises MemoryError instead
of SyntaxError, e.g. eval("[" * 50 + "]" * 50).
- In 2.0b2 on Windows, the interpreter wrote .pyc files in text mode,
rendering them useless. They are now written in binary mode again.
Standard library
- Keyword arguments are now accepted for most pattern and match object
methods in SRE, the standard regular expression engine.
- In SRE, fixed error with negative lookahead and lookbehind that
manifested itself as a runtime error in patterns like "(?<!abc)(def)".
- Several bugs in the Unicode handling and error handling in _tkinter
were fixed.
- Fix memory management errors in Merge() and Tkapp_Call() routines.
- Several changes were made to cStringIO to make it compatible with
the file-like object interface and with StringIO. If operations are
performed on a closed object, an exception is raised. The truncate
method now accepts a position argument and readline accepts a size
argument.
- There were many changes made to the linuxaudiodev module and its
test suite; as a result, a short, unexpected audio sample should now
play when the regression test is run.
Note that this module is named poorly, because it should work
correctly on any platform that supports the Open Sound System
(OSS).
The module now raises exceptions when errors occur instead of
crashing. It also defines the AFMT_A_LAW format (logarithmic A-law
audio) and defines a getptr() method that calls the
SNDCTL_DSP_GETxPTR ioctl defined in the OSS Programmer's Guide.
- The library_version attribute, introduced in an earlier beta, was
removed because it can not be supported with early versions of the C
readline library, which provides no way to determine the version at
compile-time.
- The binascii module is now enabled on Win64.
- tokenize.py no longer suffers "recursion depth" errors when parsing
programs with very long string literals.
Internals
- Fixed several buffer overflow vulnerabilities in calculate_path(),
which is called when the interpreter starts up to determine where
the standard library is installed. These vulnerabilities affect all
previous versions of Python and can be exploited by setting very
long values for PYTHONHOME or argv[0]. The risk is greatest for a
setuid Python script, although use of the wrapper in
Misc/setuid-prog.c will eliminate the vulnerability.
- Fixed garbage collection bugs in instance creation that were
triggered when errors occurred during initialization. The solution,
applied in cPickle and in PyInstance_New(), is to call
PyObject_GC_Init() after the initialization of the object's
container attributes is complete.
- pyexpat adds definitions of PyModule_AddStringConstant and
PyModule_AddObject if the Python version is less than 2.0, which
provides compatibility with PyXML on Python 1.5.2.
- If the platform has a bogus definition for LONG_BIT (the number of
bits in a long), an error will be reported at compile time.
- Fix bugs in _PyTuple_Resize() which caused hard-to-interpret garbage
collection crashes and possibly other, unreported crashes.
- Fixed a memory leak in _PyUnicode_Fini().
Build issues
- configure now accepts a --with-suffix option that specifies the
executable suffix. This is useful for builds on Cygwin and Mac OS
X, for example.
- The mmap.PAGESIZE constant is now initialized using sysconf when
possible, which eliminates a dependency on -lucb for Reliant UNIX.
- The md5 file should now compile on all platforms.
- The select module now compiles on platforms that do not define
POLLRDNORM and related constants.
- Darwin (Mac OS X): Initial support for static builds on this
platform.
- BeOS: A number of changes were made to the build and installation
process. ar-fake now operates on a directory of object files.
dl_export.h is gone, and its macros now appear on the mwcc command
line during build on PPC BeOS.
- Platform directory in lib/python2.0 is "plat-beos5" (or
"plat-beos4", if building on BeOS 4.5), rather than "plat-beos".
- Cygwin: Support for shared libraries, Tkinter, and sockets.
- SunOS 4.1.4_JL: Fix test for directory existence in configure.
Tools and other miscellany
- Removed debugging prints from main used with freeze.
- IDLE auto-indent no longer crashes when it encounters Unicode
characters.
What's new in 2.0 beta 2 (since beta 1)?
========================================
Core language, builtins, and interpreter
- Add support for unbounded ints in %d,i,u,x,X,o formats; for example
"%d" % 2L**64 == "18446744073709551616".
- Add -h and -V command line options to print the usage message and
Python version number and exit immediately.
- eval() and exec accept Unicode objects as code parameters.
- getattr() and setattr() now also accept Unicode objects for the
attribute name, which are converted to strings using the default
encoding before lookup.
- Multiplication on string and Unicode now does proper bounds
checking; e.g. 'a' * 65536 * 65536 will raise ValueError, "repeated
string is too long."
- Better error message when continue is found in try statement in a
loop.
Standard library and extensions
- socket module: the OpenSSL code now adds support for RAND_status()
and EGD (Entropy Gathering Device).
- array: reverse() method of array now works. buffer_info() now does
argument checking; it still takes no arguments.
- asyncore/asynchat: Included most recent version from Sam Rushing.
- cgi: Accept '&' or ';' as separator characters when parsing form data.
- CGIHTTPServer: Now works on Windows (and perhaps even Mac).
- ConfigParser: When reading the file, options spelled in upper case
letters are now correctly converted to lowercase.
- copy: Copy Unicode objects atomically.
- cPickle: Fail gracefully when copy_reg can't be imported.
- cStringIO: Implemented readlines() method.
- dbm: Add get() and setdefault() methods to dbm object. Add constant
`library' to module that names the library used. Added doc strings
and method names to error messages. Uses configure to determine
which ndbm.h file to include; Berkeley DB's nbdm and GDBM's ndbm is
now available options.
- distutils: Update to version 0.9.3.
- dl: Add several dl.RTLD_ constants.
- fpectl: Now supported on FreeBSD.
- gc: Add DEBUG_SAVEALL option. When enabled all garbage objects
found by the collector will be saved in gc.garbage. This is useful
for debugging a program that creates reference cycles.
- httplib: Three changes: Restore support for set_debuglevel feature
of HTTP class. Do not close socket on zero-length response. Do not
crash when server sends invalid content-length header.
- mailbox: Mailbox class conforms better to qmail specifications.
- marshal: When reading a short, sign-extend on platforms where shorts
are bigger than 16 bits. When reading a long, repair the unportable
sign extension that was being done for 64-bit machines. (It assumed
that signed right shift sign-extends.)
- operator: Add contains(), invert(), __invert__() as aliases for
__contains__(), inv(), and __inv__() respectively.
- os: Add support for popen2() and popen3() on all platforms where
fork() exists. (popen4() is still in the works.)
- os: (Windows only:) Add startfile() function that acts like double-
clicking on a file in Explorer (or passing the file name to the
DOS "start" command).
- os.path: (Windows, DOS:) Treat trailing colon correctly in
os.path.join. os.path.join("a:", "b") yields "a:b".
- pickle: Now raises ValueError when an invalid pickle that contains
a non-string repr where a string repr was expected. This behavior
matches cPickle.
- posixfile: Remove broken __del__() method.
- py_compile: support CR+LF line terminators in source file.
- readline: Does not immediately exit when ^C is hit when readline and
threads are configured. Adds definition of rl_library_version. (The
latter addition requires GNU readline 2.2 or later.)
- rfc822: Domain literals returned by AddrlistClass method
getdomainliteral() are now properly wrapped in brackets.
- site: sys.setdefaultencoding() should only be called in case the
standard default encoding ("ascii") is changed. This saves quite a
few cycles during startup since the first call to
setdefaultencoding() will initialize the codec registry and the
encodings package.
- socket: Support for size hint in readlines() method of object returned
by makefile().
- sre: Added experimental expand() method to match objects. Does not
use buffer interface on Unicode strings. Does not hang if group id
is followed by whitespace.
- StringIO: Size hint in readlines() is now supported as documented.
- struct: Check ranges for bytes and shorts.
- urllib: Improved handling of win32 proxy settings. Fixed quote and
quote_plus functions so that the always encode a comma.
- Tkinter: Image objects are now guaranteed to have unique ids. Set
event.delta to zero if Tk version doesn't support mousewheel.
Removed some debugging prints.
- UserList: now implements __contains__().
- webbrowser: On Windows, use os.startfile() instead of os.popen(),
which works around a bug in Norton AntiVirus 2000 that leads directly
to a Blue Screen freeze.
- xml: New version detection code allows PyXML to override standard
XML package if PyXML version is greater than 0.6.1.
- xml.dom: DOM level 1 support for basic XML. Includes xml.dom.minidom
(conventional DOM), and xml.dom.pulldom, which allows building the DOM
tree only for nodes which are sufficiently interesting to a specific
application. Does not provide the HTML-specific extensions. Still
undocumented.
- xml.sax: SAX 2 support for Python, including all the handler
interfaces needed to process XML 1.0 compliant XML. Some
documentation is already available.
- pyexpat: Renamed to xml.parsers.expat since this is part of the new,
packagized XML support.
C API
- Add three new convenience functions for module initialization --
PyModule_AddObject(), PyModule_AddIntConstant(), and
PyModule_AddStringConstant().
- Cleaned up definition of NULL in C source code; all definitions were
removed and add #error to Python.h if NULL isn't defined after
#include of stdio.h.
- Py_PROTO() macros that were removed in 2.0b1 have been restored for
backwards compatibility (at the source level) with old extensions.
- A wrapper API was added for signal() and sigaction(). Instead of
either function, always use PyOS_getsig() to get a signal handler
and PyOS_setsig() to set one. A new convenience typedef
PyOS_sighandler_t is defined for the type of signal handlers.
- Add PyString_AsStringAndSize() function that provides access to the
internal data buffer and size of a string object -- or the default
encoded version of a Unicode object.
- PyString_Size() and PyString_AsString() accept Unicode objects.
- The standard header <limits.h> is now included by Python.h (if it
exists). INT_MAX and LONG_MAX will always be defined, even if
<limits.h> is not available.
- PyFloat_FromString takes a second argument, pend, that was
effectively useless. It is now officially useless but preserved for
backwards compatibility. If the pend argument is not NULL, *pend is
set to NULL.
- PyObject_GetAttr() and PyObject_SetAttr() now accept Unicode objects
for the attribute name. See note on getattr() above.
- A few bug fixes to argument processing for Unicode.
PyArg_ParseTupleAndKeywords() now accepts "es#" and "es".
PyArg_Parse() special cases "s#" for Unicode objects; it returns a
pointer to the default encoded string data instead of to the raw
UTF-16.
- Py_BuildValue accepts B format (for bgen-generated code).
Internals
- On Unix, fix code for finding Python installation directory so that
it works when argv[0] is a relative path.
- Added a true unicode_internal_encode() function and fixed the
unicode_internal_decode function() to support Unicode objects directly
rather than by generating a copy of the object.
- Several of the internal Unicode tables are much smaller now, and
the source code should be much friendlier to weaker compilers.
- In the garbage collector: Fixed bug in collection of tuples. Fixed
bug that caused some instances to be removed from the container set
while they were still live. Fixed parsing in gc.set_debug() for
platforms where sizeof(long) > sizeof(int).
- Fixed refcount problem in instance deallocation that only occurred
when Py_REF_DEBUG was defined and Py_TRACE_REFS was not.
- On Windows, getpythonregpath is now protected against null data in
registry key.
- On Unix, create .pyc/.pyo files with O_EXCL flag to avoid a race
condition.
Build and platform-specific issues
- Better support of GNU Pth via --with-pth configure option.
- Python/C API now properly exposed to dynamically-loaded extension
modules on Reliant UNIX.
- Changes for the benefit of SunOS 4.1.4 (really!). mmapmodule.c:
Don't define MS_SYNC to be zero when it is undefined. Added missing
prototypes in posixmodule.c.
- Improved support for HP-UX build. Threads should now be correctly
configured (on HP-UX 10.20 and 11.00).
- Fix largefile support on older NetBSD systems and OpenBSD by adding
define for TELL64.
Tools and other miscellany
- ftpmirror: Call to main() is wrapped in if __name__ == "__main__".
- freeze: The modulefinder now works with 2.0 opcodes.
- IDLE:
Move hackery of sys.argv until after the Tk instance has been
created, which allows the application-specific Tkinter
initialization to be executed if present; also pass an explicit
className parameter to the Tk() constructor.
What's new in 2.0 beta 1?
=========================
Source Incompatibilities
------------------------
None. Note that 1.6 introduced several incompatibilities with 1.5.2,
such as single-argument append(), connect() and bind(), and changes to
str(long) and repr(float).
Binary Incompatibilities
------------------------
- Third party extensions built for Python 1.5.x or 1.6 cannot be used
with Python 2.0; these extensions will have to be rebuilt for Python
2.0.
- On Windows, attempting to import a third party extension built for
Python 1.5.x or 1.6 results in an immediate crash; there's not much we
can do about this. Check your PYTHONPATH environment variable!
- Python bytecode files (*.pyc and *.pyo) are not compatible between
releases.
Overview of Changes Since 1.6
-----------------------------
There are many new modules (including brand new XML support through
the xml package, and i18n support through the gettext module); a list
of all new modules is included below. Lots of bugs have been fixed.
The process for making major new changes to the language has changed
since Python 1.6. Enhancements must now be documented by a Python
Enhancement Proposal (PEP) before they can be accepted.
There are several important syntax enhancements, described in more
detail below:
- Augmented assignment, e.g. x += 1
- List comprehensions, e.g. [x**2 for x in range(10)]
- Extended import statement, e.g. import Module as Name
- Extended print statement, e.g. print >> file, "Hello"
Other important changes:
- Optional collection of cyclical garbage
Python Enhancement Proposal (PEP)
---------------------------------
PEP stands for Python Enhancement Proposal. A PEP is a design
document providing information to the Python community, or describing
a new feature for Python. The PEP should provide a concise technical
specification of the feature and a rationale for the feature.
We intend PEPs to be the primary mechanisms for proposing new
features, for collecting community input on an issue, and for
documenting the design decisions that have gone into Python. The PEP
author is responsible for building consensus within the community and
documenting dissenting opinions.
The PEPs are available at http://python.sourceforge.net/peps/.
Augmented Assignment
--------------------
This must have been the most-requested feature of the past years!
Eleven new assignment operators were added:
+= -= *= /= %= **= <<= >>= &= ^= |=
For example,
A += B
is similar to
A = A + B
except that A is evaluated only once (relevant when A is something
like dict[index].attr).
However, if A is a mutable object, A may be modified in place. Thus,
if A is a number or a string, A += B has the same effect as A = A+B
(except A is only evaluated once); but if a is a list, A += B has the
same effect as A.extend(B)!
Classes and built-in object types can override the new operators in
order to implement the in-place behavior; the not-in-place behavior is
used automatically as a fallback when an object doesn't implement the
in-place behavior. For classes, the method name is derived from the
method name for the corresponding not-in-place operator by inserting
an 'i' in front of the name, e.g. __iadd__ implements in-place
__add__.
Augmented assignment was implemented by Thomas Wouters.
List Comprehensions
-------------------
This is a flexible new notation for lists whose elements are computed
from another list (or lists). The simplest form is:
[<expression> for <variable> in <sequence>]
For example, [i**2 for i in range(4)] yields the list [0, 1, 4, 9].
This is more efficient than a for loop with a list.append() call.
You can also add a condition:
[<expression> for <variable> in <sequence> if <condition>]
For example, [w for w in words if w == w.lower()] would yield the list
of words that contain no uppercase characters. This is more efficient
than a for loop with an if statement and a list.append() call.
You can also have nested for loops and more than one 'if' clause. For
example, here's a function that flattens a sequence of sequences::
def flatten(seq):
return [x for subseq in seq for x in subseq]
flatten([[0], [1,2,3], [4,5], [6,7,8,9], []])
This prints
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
List comprehensions originated as a patch set from Greg Ewing; Skip
Montanaro and Thomas Wouters also contributed. Described by PEP 202.
Extended Import Statement
-------------------------
Many people have asked for a way to import a module under a different
name. This can be accomplished like this:
import foo
bar = foo
del foo
but this common idiom gets old quickly. A simple extension of the
import statement now allows this to be written as follows:
import foo as bar
There's also a variant for 'from ... import':
from foo import bar as spam
This also works with packages; e.g. you can write this:
import test.regrtest as regrtest
Note that 'as' is not a new keyword -- it is recognized only in this
context (this is only possible because the syntax for the import
statement doesn't involve expressions).
Implemented by Thomas Wouters. Described by PEP 221.
Extended Print Statement
------------------------
Easily the most controversial new feature, this extension to the print
statement adds an option to make the output go to a different file
than the default sys.stdout.
For example, to write an error message to sys.stderr, you can now
write:
print >> sys.stderr, "Error: bad dog!"
As a special feature, if the expression used to indicate the file
evaluates to None, the current value of sys.stdout is used. Thus:
print >> None, "Hello world"
is equivalent to
print "Hello world"
Design and implementation by Barry Warsaw. Described by PEP 214.
Optional Collection of Cyclical Garbage
---------------------------------------
Python is now equipped with a garbage collector that can hunt down
cyclical references between Python objects. It's no replacement for
reference counting; in fact, it depends on the reference counts being
correct, and decides that a set of objects belong to a cycle if all
their reference counts can be accounted for from their references to
each other. This devious scheme was first proposed by Eric Tiedemann,
and brought to implementation by Neil Schemenauer.
There's a module "gc" that lets you control some parameters of the
garbage collection. There's also an option to the configure script
that lets you enable or disable the garbage collection. In 2.0b1,
it's on by default, so that we (hopefully) can collect decent user
experience with this new feature. There are some questions about its
performance. If it proves to be too much of a problem, we'll turn it
off by default in the final 2.0 release.
Smaller Changes
---------------
A new function zip() was added. zip(seq1, seq2, ...) is equivalent to
map(None, seq1, seq2, ...) when the sequences have the same length;
i.e. zip([1,2,3], [10,20,30]) returns [(1,10), (2,20), (3,30)]. When
the lists are not all the same length, the shortest list wins:
zip([1,2,3], [10,20]) returns [(1,10), (2,20)]. See PEP 201.
sys.version_info is a tuple (major, minor, micro, level, serial).
Dictionaries have an odd new method, setdefault(key, default).
dict.setdefault(key, default) returns dict[key] if it exists; if not,
it sets dict[key] to default and returns that value. Thus:
dict.setdefault(key, []).append(item)
does the same work as this common idiom:
if not dict.has_key(key):
dict[key] = []
dict[key].append(item)
There are two new variants of SyntaxError that are raised for
indentation-related errors: IndentationError and TabError.
Changed \x to consume exactly two hex digits; see PEP 223. Added \U
escape that consumes exactly eight hex digits.
The limits on the size of expressions and file in Python source code
have been raised from 2**16 to 2**32. Previous versions of Python
were limited because the maximum argument size the Python VM accepted
was 2**16. This limited the size of object constructor expressions,
e.g. [1,2,3] or {'a':1, 'b':2}, and the size of source files. This
limit was raised thanks to a patch by Charles Waldman that effectively
fixes the problem. It is now much more likely that you will be
limited by available memory than by an arbitrary limit in Python.
The interpreter's maximum recursion depth can be modified by Python
programs using sys.getrecursionlimit and sys.setrecursionlimit. This
limit is the maximum number of recursive calls that can be made by
Python code. The limit exists to prevent infinite recursion from
overflowing the C stack and causing a core dump. The default value is
1000. The maximum safe value for a particular platform can be found
by running Misc/find_recursionlimit.py.
New Modules and Packages
------------------------
atexit - for registering functions to be called when Python exits.
imputil - Greg Stein's alternative API for writing custom import
hooks.
pyexpat - an interface to the Expat XML parser, contributed by Paul
Prescod.
xml - a new package with XML support code organized (so far) in three
subpackages: xml.dom, xml.sax, and xml.parsers. Describing these
would fill a volume. There's a special feature whereby a
user-installed package named _xmlplus overrides the standard
xmlpackage; this is intended to give the XML SIG a hook to distribute
backwards-compatible updates to the standard xml package.
webbrowser - a platform-independent API to launch a web browser.
Changed Modules
---------------
array -- new methods for array objects: count, extend, index, pop, and
remove
binascii -- new functions b2a_hex and a2b_hex that convert between
binary data and its hex representation
calendar -- Many new functions that support features including control
over which day of the week is the first day, returning strings instead
of printing them. Also new symbolic constants for days of week,
e.g. MONDAY, ..., SUNDAY.
cgi -- FieldStorage objects have a getvalue method that works like a
dictionary's get method and returns the value attribute of the object.
ConfigParser -- The parser object has new methods has_option,
remove_section, remove_option, set, and write. They allow the module
to be used for writing config files as well as reading them.
ftplib -- ntransfercmd(), transfercmd(), and retrbinary() all now
optionally support the RFC 959 REST command.
gzip -- readline and readlines now accept optional size arguments
httplib -- New interfaces and support for HTTP/1.1 by Greg Stein. See
the module doc strings for details.
locale -- implement getdefaultlocale for Win32 and Macintosh
marshal -- no longer dumps core when marshaling deeply nested or
recursive data structures
os -- new functions isatty, seteuid, setegid, setreuid, setregid
os/popen2 -- popen2/popen3/popen4 support under Windows. popen2/popen3
support under Unix.
os/pty -- support for openpty and forkpty
os.path -- fix semantics of os.path.commonprefix
smtplib -- support for sending very long messages
socket -- new function getfqdn()
readline -- new functions to read, write and truncate history files.
The readline section of the library reference manual contains an
example.
select -- add interface to poll system call
shutil -- new copyfileobj function
SimpleHTTPServer, CGIHTTPServer -- Fix problems with buffering in the
HTTP server.
Tkinter -- optimization of function flatten
urllib -- scans environment variables for proxy configuration,
e.g. http_proxy.
whichdb -- recognizes dumbdbm format
Obsolete Modules
----------------
None. However note that 1.6 made a whole slew of modules obsolete:
stdwin, soundex, cml, cmpcache, dircache, dump, find, grep, packmail,
poly, zmod, strop, util, whatsound.
Changed, New, Obsolete Tools
----------------------------
None.
C-level Changes
---------------
Several cleanup jobs were carried out throughout the source code.
All C code was converted to ANSI C; we got rid of all uses of the
Py_PROTO() macro, which makes the header files a lot more readable.
Most of the portability hacks were moved to a new header file,
pyport.h; several other new header files were added and some old
header files were removed, in an attempt to create a more rational set
of header files. (Few of these ever need to be included explicitly;
they are all included by Python.h.)
Trent Mick ensured portability to 64-bit platforms, under both Linux
and Win64, especially for the new Intel Itanium processor. Mick also
added large file support for Linux64 and Win64.
The C APIs to return an object's size have been update to consistently
use the form PyXXX_Size, e.g. PySequence_Size and PyDict_Size. In
previous versions, the abstract interfaces used PyXXX_Length and the
concrete interfaces used PyXXX_Size. The old names,
e.g. PyObject_Length, are still available for backwards compatibility
at the API level, but are deprecated.
The PyOS_CheckStack function has been implemented on Windows by
Fredrik Lundh. It prevents Python from failing with a stack overflow
on Windows.
The GC changes resulted in creation of two new slots on object,
tp_traverse and tp_clear. The augmented assignment changes result in
the creation of a new slot for each in-place operator.
The GC API creates new requirements for container types implemented in
C extension modules. See Include/objimpl.h for details.
PyErr_Format has been updated to automatically calculate the size of
the buffer needed to hold the formatted result string. This change
prevents crashes caused by programmer error.
New C API calls: PyObject_AsFileDescriptor, PyErr_WriteUnraisable.
PyRun_AnyFileEx, PyRun_SimpleFileEx, PyRun_FileEx -- New functions
that are the same as their non-Ex counterparts except they take an
extra flag argument that tells them to close the file when done.
XXX There were other API changes that should be fleshed out here.
Windows Changes
---------------
New popen2/popen3/peopen4 in os module (see Changed Modules above).
os.popen is much more usable on Windows 95 and 98. See Microsoft
Knowledge Base article Q150956. The Win9x workaround described there
is implemented by the new w9xpopen.exe helper in the root of your
Python installation. Note that Python uses this internally; it is not
a standalone program.
Administrator privileges are no longer required to install Python
on Windows NT or Windows 2000. If you have administrator privileges,
Python's registry info will be written under HKEY_LOCAL_MACHINE.
Otherwise the installer backs off to writing Python's registry info
under HKEY_CURRENT_USER. The latter is sufficient for all "normal"
uses of Python, but will prevent some advanced uses from working
(for example, running a Python script as an NT service, or possibly
from CGI).
[This was new in 1.6] The installer no longer runs a separate Tcl/Tk
installer; instead, it installs the needed Tcl/Tk files directly in the
Python directory. If you already have a Tcl/Tk installation, this
wastes some disk space (about 4 Megs) but avoids problems with
conflicting Tcl/Tk installations, and makes it much easier for Python
to ensure that Tcl/Tk can find all its files.
[This was new in 1.6] The Windows installer now installs by default in
\Python20\ on the default volume, instead of \Program Files\Python-2.0\.
Updates to the changes between 1.5.2 and 1.6
--------------------------------------------
The 1.6 NEWS file can't be changed after the release is done, so here
is some late-breaking news:
New APIs in locale.py: normalize(), getdefaultlocale(), resetlocale(),
and changes to getlocale() and setlocale().
The new module is now enabled per default.
It is not true that the encodings codecs cannot be used for normal
strings: the string.encode() (which is also present on 8-bit strings
!) allows using them for 8-bit strings too, e.g. to convert files from
cp1252 (Windows) to latin-1 or vice-versa.
Japanese codecs are available from Tamito KAJIYAMA:
http://pseudo.grad.sccs.chukyo-u.ac.jp/~kajiyama/python/
======================================================================
=======================================
==> Release 1.6 (September 5, 2000) <==
=======================================
What's new in release 1.6?
==========================
Below is a list of all relevant changes since release 1.5.2.
Source Incompatibilities
------------------------
Several small incompatible library changes may trip you up:
- The append() method for lists can no longer be invoked with more
than one argument. This used to append a single tuple made out of
all arguments, but was undocumented. To append a tuple, use
e.g. l.append((a, b, c)).
- The connect(), connect_ex() and bind() methods for sockets require
exactly one argument. Previously, you could call s.connect(host,
port), but this was undocumented. You must now write
s.connect((host, port)).
- The str() and repr() functions are now different more often. For
long integers, str() no longer appends a 'L'. Thus, str(1L) == '1',
which used to be '1L'; repr(1L) is unchanged and still returns '1L'.
For floats, repr() now gives 17 digits of precision, to ensure no
precision is lost (on all current hardware).
- The -X option is gone. Built-in exceptions are now always
classes. Many more library modules also have been converted to
class-based exceptions.
Binary Incompatibilities
------------------------
- Third party extensions built for Python 1.5.x cannot be used with
Python 1.6; these extensions will have to be rebuilt for Python 1.6.
- On Windows, attempting to import a third party extension built for
Python 1.5.x results in an immediate crash; there's not much we can do
about this. Check your PYTHONPATH environment variable!
Overview of Changes since 1.5.2
-------------------------------
For this overview, I have borrowed from the document "What's New in
Python 2.0" by Andrew Kuchling and Moshe Zadka:
http://starship.python.net/crew/amk/python/writing/new-python/.
There are lots of new modules and lots of bugs have been fixed. A
list of all new modules is included below.
Probably the most pervasive change is the addition of Unicode support.
We've added a new fundamental datatype, the Unicode string, a new
build-in function unicode(), an numerous C APIs to deal with Unicode
and encodings. See the file Misc/unicode.txt for details, or
http://starship.python.net/crew/lemburg/unicode-proposal.txt.
Two other big changes, related to the Unicode support, are the
addition of string methods and (yet another) new regular expression
engine.
- String methods mean that you can now say s.lower() etc. instead of
importing the string module and saying string.lower(s) etc. One
peculiarity is that the equivalent of string.join(sequence,
delimiter) is delimiter.join(sequence). Use " ".join(sequence) for
the effect of string.join(sequence); to make this more readable, try
space=" " first. Note that the maxsplit argument defaults in
split() and replace() have changed from 0 to -1.
- The new regular expression engine, SRE by Fredrik Lundh, is fully
backwards compatible with the old engine, and is in fact invoked
using the same interface (the "re" module). You can explicitly
invoke the old engine by import pre, or the SRE engine by importing
sre. SRE is faster than pre, and supports Unicode (which was the
main reason to put effort in yet another new regular expression
engine -- this is at least the fourth!).
Other Changes
-------------
Other changes that won't break code but are nice to know about:
Deleting objects is now safe even for deeply nested data structures.
Long/int unifications: long integers can be used in seek() calls, as
slice indexes.
String formatting (s % args) has a new formatting option, '%r', which
acts like '%s' but inserts repr(arg) instead of str(arg). (Not yet in
alpha 1.)
Greg Ward's "distutils" package is included: this will make
installing, building and distributing third party packages much
simpler.
There's now special syntax that you can use instead of the apply()
function. f(*args, **kwds) is equivalent to apply(f, args, kwds).
You can also use variations f(a1, a2, *args, **kwds) and you can leave
one or the other out: f(*args), f(**kwds).
The built-ins int() and long() take an optional second argument to
indicate the conversion base -- of course only if the first argument
is a string. This makes string.atoi() and string.atol() obsolete.
(string.atof() was already obsolete).
When a local variable is known to the compiler but undefined when
used, a new exception UnboundLocalError is raised. This is a class
derived from NameError so code catching NameError should still work.
The purpose is to provide better diagnostics in the following example:
x = 1
def f():
print x
x = x+1
This used to raise a NameError on the print statement, which confused
even experienced Python programmers (especially if there are several
hundreds of lines of code between the reference and the assignment to
x :-).
You can now override the 'in' operator by defining a __contains__
method. Note that it has its arguments backwards: x in a causes
a.__contains__(x) to be called. That's why the name isn't __in__.
The exception AttributeError will have a more friendly error message,
e.g.: <code>'Spam' instance has no attribute 'eggs'</code>. This may
<b>break code</b> that expects the message to be exactly the attribute
name.
New Modules in 1.6
------------------
UserString - base class for deriving from the string type.
distutils - tools for distributing Python modules.
robotparser - parse a robots.txt file, for writing web spiders.
(Moved from Tools/webchecker/.)
linuxaudiodev - audio for Linux.
mmap - treat a file as a memory buffer. (Windows and Unix.)
sre - regular expressions (fast, supports unicode). Currently, this
code is very rough. Eventually, the re module will be reimplemented
using sre (without changes to the re API).
filecmp - supersedes the old cmp.py and dircmp.py modules.
tabnanny - check Python sources for tab-width dependance. (Moved from
Tools/scripts/.)
urllib2 - new and improved but incompatible version of urllib (still
experimental).
zipfile - read and write zip archives.
codecs - support for Unicode encoders/decoders.
unicodedata - provides access to the Unicode 3.0 database.
_winreg - Windows registry access.
encodings - package which provides a large set of standard codecs --
currently only for the new Unicode support. It has a drop-in extension
mechanism which allows you to add new codecs by simply copying them
into the encodings package directory. Asian codec support will
probably be made available as separate distribution package built upon
this technique and the new distutils package.
Changed Modules
---------------
readline, ConfigParser, cgi, calendar, posix, readline, xmllib, aifc,
chunk, wave, random, shelve, nntplib - minor enhancements.
socket, httplib, urllib - optional OpenSSL support (Unix only).
_tkinter - support for 8.0 up to 8.3. Support for versions older than
8.0 has been dropped.
string - most of this module is deprecated now that strings have
methods. This no longer uses the built-in strop module, but takes
advantage of the new string methods to provide transparent support for
both Unicode and ordinary strings.
Changes on Windows
------------------
The installer no longer runs a separate Tcl/Tk installer; instead, it
installs the needed Tcl/Tk files directly in the Python directory. If
you already have a Tcl/Tk installation, this wastes some disk space
(about 4 Megs) but avoids problems with conflincting Tcl/Tk
installations, and makes it much easier for Python to ensure that
Tcl/Tk can find all its files. Note: the alpha installers don't
include the documentation.
The Windows installer now installs by default in \Python16\ on the
default volume, instead of \Program Files\Python-1.6\.
Changed Tools
-------------
IDLE - complete overhaul. See the <a href="../idle/">IDLE home
page</a> for more information. (Python 1.6 alpha 1 will come with
IDLE 0.6.)
Tools/i18n/pygettext.py - Python equivalent of xgettext(1). A message
text extraction tool used for internationalizing applications written
in Python.
Obsolete Modules
----------------
stdwin and everything that uses it. (Get Python 1.5.2 if you need
it. :-)
soundex. (Skip Montanaro has a version in Python but it won't be
included in the Python release.)
cmp, cmpcache, dircmp. (Replaced by filecmp.)
dump. (Use pickle.)
find. (Easily coded using os.walk().)
grep. (Not very useful as a library module.)
packmail. (No longer has any use.)
poly, zmod. (These were poor examples at best.)
strop. (No longer needed by the string module.)
util. (This functionality was long ago built in elsewhere).
whatsound. (Use sndhdr.)
Detailed Changes from 1.6b1 to 1.6
----------------------------------
- Slight changes to the CNRI license. A copyright notice has been
added; the requirement to indicate the nature of modifications now
applies when making a derivative work available "to others" instead of
just "to the public"; the version and date are updated. The new
license has a new handle.
- Added the Tools/compiler package. This is a project led by Jeremy
Hylton to write the Python bytecode generator in Python.
- The function math.rint() is removed.
- In Python.h, "#define _GNU_SOURCE 1" was added.
- Version 0.9.1 of Greg Ward's distutils is included (instead of
version 0.9).
- A new version of SRE is included. It is more stable, and more
compatible with the old RE module. Non-matching ranges are indicated
by -1, not None. (The documentation said None, but the PRE
implementation used -1; changing to None would break existing code.)
- The winreg module has been renamed to _winreg. (There are plans for
a higher-level API called winreg, but this has not yet materialized in
a form that is acceptable to the experts.)
- The _locale module is enabled by default.
- Fixed the configuration line for the _curses module.
- A few crashes have been fixed, notably <file>.writelines() with a
list containing non-string objects would crash, and there were
situations where a lost SyntaxError could dump core.
- The <list>.extend() method now accepts an arbitrary sequence
argument.
- If __str__() or __repr__() returns a Unicode object, this is
converted to an 8-bit string.
- Unicode string comparisons is no longer aware of UTF-16
encoding peculiarities; it's a straight 16-bit compare.
- The Windows installer now installs the LICENSE file and no longer
registers the Python DLL version in the registry (this is no longer
needed). It now uses Tcl/Tk 8.3.2.
- A few portability problems have been fixed, in particular a
compilation error involving socklen_t.
- The PC configuration is slightly friendlier to non-Microsoft
compilers.
======================================================================
======================================
==> Release 1.5.2 (April 13, 1999) <==
======================================
From 1.5.2c1 to 1.5.2 (final)
=============================
Tue Apr 13 15:44:49 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* PCbuild/python15.wse: Bump version to 1.5.2 (final)
* PCbuild/python15.dsp: Added shamodule.c
* PC/config.c: Added sha module!
* README, Include/patchlevel.h: Prepare for final release.
* Misc/ACKS:
More (Cameron Laird is honorary; the others are 1.5.2c1 testers).
* Python/thread_solaris.h:
While I can't really test this thoroughly, Pat Knight and the Solaris
man pages suggest that the proper thing to do is to add THR_NEW_LWP to
the flags on thr_create(), and that there really isn't a downside, so
I'll do that.
* Misc/ACKS:
Bunch of new names who helped iron out the last wrinkles of 1.5.2.
* PC/python_nt.rc:
Bump the myusterious M$ version number from 1,5,2,1 to 1,5,2,3.
(I can't even display this on NT, maybe Win/98 can?)
* Lib/pstats.py:
Fix mysterious references to jprofile that were in the source since
its creation. I'm assuming these were once valid references to "Jim
Roskind's profile"...
* Lib/Attic/threading_api.py:
Removed; since long subsumed in Doc/lib/libthreading.tex
* Modules/socketmodule.c:
Put back __osf__ support for gethostbyname_r(); the real bug was that
it was being used even without threads. This of course might be an
all-platform problem so now we only use the _r variant when we are
using threads.
Mon Apr 12 22:51:20 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Modules/cPickle.c:
Fix accidentally reversed NULL test in load_mark(). Suggested by
Tamito Kajiyama. (This caused a bug only on platforms where malloc(0)
returns NULL.)
* README:
Add note about popen2 problem on Linux noticed by Pablo Bleyer.
* README: Add note about -D_REENTRANT for HP-UX 10.20.
* Modules/Makefile.pre.in: 'clean' target should remove hassignal.
* PC/Attic/vc40.mak, PC/readme.txt:
Remove all VC++ info (except VC 1.5) from readme.txt;
remove the VC++ 4.0 project file; remove the unused _tkinter extern defs.
* README: Clarify PC build instructions (point to PCbuild).
* Modules/zlibmodule.c: Cast added by Jack Jansen (for Mac port).
* Lib/plat-sunos5/CDIO.py, Lib/plat-linux2/CDROM.py:
Forgot to add this file. CDROM device parameters.
* Lib/gzip.py: Two different changes.
1. Jack Jansen reports that on the Mac, the time may be negative, and
solves this by adding a write32u() function that writes an unsigned
long.
2. On 64-bit platforms the CRC comparison fails; I've fixed this by
casting both values to be compared to "unsigned long" i.e. modulo
0x100000000L.
Sat Apr 10 18:42:02 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* PC/Attic/_tkinter.def: No longer needed.
* Misc/ACKS: Correct missed character in Andrew Dalke's name.
* README: Add DEC Ultrix notes (from Donn Cave's email).
* configure: The usual
* configure.in:
Quote a bunch of shell variables used in test, related to long-long.
* Objects/fileobject.c, Modules/shamodule.c, Modules/regexpr.c:
casts for picky compilers.
* Modules/socketmodule.c:
3-arg gethostbyname_r doesn't really work on OSF/1.
* PC/vc15_w31/_.c, PC/vc15_lib/_.c, Tools/pynche/__init__.py:
Avoid totally empty files.
Fri Apr 9 14:56:35 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Tools/scripts/fixps.py: Use re instead of regex.
Don't rewrite the file in place.
(Reported by Andy Dustman.)
* Lib/netrc.py, Lib/shlex.py: Get rid of #! line
Thu Apr 8 23:13:37 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* PCbuild/python15.wse: Use the Tcl 8.0.5 installer.
Add a variable %_TCL_% that makes it easier to switch to a different version.
======================================================================
From 1.5.2b2 to 1.5.2c1
=======================
Thu Apr 8 23:13:37 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* PCbuild/python15.wse:
Release 1.5.2c1. Add IDLE and Uninstall to program group.
Don't distribute zlib.dll. Tweak some comments.
* PCbuild/zlib.dsp: Now using static zlib 1.1.3
* Lib/dos-8x3/userdict.py, Lib/dos-8x3/userlist.py, Lib/dos-8x3/test_zli.py, Lib/dos-8x3/test_use.py, Lib/dos-8x3/test_pop.py, Lib/dos-8x3/test_pic.py, Lib/dos-8x3/test_ntp.py, Lib/dos-8x3/test_gzi.py, Lib/dos-8x3/test_fcn.py, Lib/dos-8x3/test_cpi.py, Lib/dos-8x3/test_bsd.py, Lib/dos-8x3/posixfil.py, Lib/dos-8x3/mimetype.py, Lib/dos-8x3/nturl2pa.py, Lib/dos-8x3/compilea.py, Lib/dos-8x3/exceptio.py, Lib/dos-8x3/basehttp.py:
The usual
* Include/patchlevel.h: Release 1.5.2c1
* README: Release 1.5.2c1.
* Misc/NEWS: News for the 1.5.2c1 release.
* Lib/test/test_strftime.py:
On Windows, we suddenly find, strftime() may return "" for an
unsupported format string. (I guess this is because the logic for
deciding whether to reallocate the buffer or not has been improved.)
This caused the test code to crash on result[0]. Fix this by assuming
an empty result also means the format is not supported.
* Demo/tkinter/matt/window-creation-w-location.py:
This demo imported some private code from Matt. Make it cripple along.
* Lib/lib-tk/Tkinter.py:
Delete an accidentally checked-in feature that actually broke more
than was worth it: when deleting a canvas item, it would try to
automatically delete the bindings for that item. Since there's
nothing that says you can't reuse the tag and still have the bindings,
this is not correct. Also, it broke at least one demo
(Demo/tkinter/matt/rubber-band-box-demo-1.py).
* Python/thread_wince.h: Win/CE thread support by Mark Hammond.
Wed Apr 7 20:23:17 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Modules/zlibmodule.c:
Patch by Andrew Kuchling to unflush() (flush() for deflating).
Without this, if inflate() returned Z_BUF_ERROR asking for more output
space, we would report the error; now, we increase the buffer size and
try again, just as for Z_OK.
* Lib/test/test_gzip.py: Use binary mode for all gzip files we open.
* Tools/idle/ChangeLog: New change log.
* Tools/idle/README.txt, Tools/idle/NEWS.txt: New version.
* Python/pythonrun.c:
Alas, get rid of the Win specific hack to ask the user to press Return
before exiting when an error happened. This didn't work right when
Python is invoked from a daemon.
* Tools/idle/idlever.py: Version bump awaiting impending new release.
(Not much has changed :-( )
* Lib/lib-tk/Tkinter.py:
lower, tkraise/lift hide Misc.lower, Misc.tkraise/lift,
so the preferred name for them is tag_lower, tag_raise
(similar to tag_bind, and similar to the Text widget);
unfortunately can't delete the old ones yet (maybe in 1.6)
* Python/thread.c, Python/strtod.c, Python/mystrtoul.c, Python/import.c, Python/ceval.c:
Changes by Mark Hammond for Windows CE. Mostly of the form
#ifdef DONT_HAVE_header_H ... #endif around #include <header.h>.
* Python/bltinmodule.c:
Remove unused variable from complex_from_string() code.
* Include/patchlevel.h:
Add the possibility of a gamma release (release candidate).
Add '+' to string version number to indicate we're beyond b2 now.
* Modules/posixmodule.c: Add extern decl for fsync() for SunOS 4.x.
* Lib/smtplib.py: Changes by Per Cederquist and The Dragon.
Per writes:
"""
The application where Signum Support uses smtplib needs to be able to
report good error messages to the user when sending email fails. To
help in diagnosing problems it is useful to be able to report the
entire message sent by the server, not only the SMTP error code of the
offending command.
A lot of the functions in sendmail.py unfortunately discards the
message, leaving only the code. The enclosed patch fixes that
problem.
The enclosed patch also introduces a base class for exceptions that
include an SMTP error code and error message, and make the code and
message available on separate attributes, so that surrounding code can
deal with them in whatever way it sees fit. I've also added some
documentation to the exception classes.
The constructor will now raise an exception if it cannot connect to
the SMTP server.
The data() method will raise an SMTPDataError if it doesn't receive
the expected 354 code in the middle of the exchange.
According to section 5.2.10 of RFC 1123 a smtp client must accept "any
text, including no text at all" after the error code. If the response
of a HELO command contains no text self.helo_resp will be set to the
empty string (""). The patch fixes the test in the sendmail() method
so that helo_resp is tested against None; if it has the empty string
as value the sendmail() method would invoke the helo() method again.
The code no longer accepts a -1 reply from the ehlo() method in
sendmail().
[Text about removing SMTPRecipientsRefused deleted --GvR]
"""
and also:
"""
smtplib.py appends an extra blank line to the outgoing mail if the
`msg' argument to the sendmail method already contains a trailing
newline. This patch should fix the problem.
"""
The Dragon writes:
"""
Mostly I just re-added the SMTPRecipientsRefused exception
(the exeption object now has the appropriate info in it ) [Per had
removed this in his patch --GvR] and tweaked the behavior of the
sendmail method whence it throws the newly added SMTPHeloException (it
was closing the connection, which it shouldn't. whatever catches the
exception should do that. )
I pondered the change of the return values to tuples all around,
and after some thinking I decided that regularizing the return values was
too much of the Right Thing (tm) to not do.
My one concern is that code expecting an integer & getting a tuple
may fail silently.
(i.e. if it's doing :
x.somemethod() >= 400:
expecting an integer, the expression will always be true if it gets a
tuple instead. )
However, most smtplib code I've seen only really uses the
sendmail() method, so this wouldn't bother it. Usually code I've seen
that calls the other methods usually only calls helo() and ehlo() for
doing ESMTP, a feature which was not in the smtplib included with 1.5.1,
and thus I would think not much code uses it yet.
"""
Tue Apr 6 19:38:18 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/test/test_ntpath.py:
Fix the tests now that splitdrive() no longer treats UNC paths special.
(Some tests converted to splitunc() tests.)
* Lib/ntpath.py:
Withdraw the UNC support from splitdrive(). Instead, a new function
splitunc() parses UNC paths. The contributor of the UNC parsing in
splitdrive() doesn't like it, but I haven't heard a good reason to
keep it, and it causes some problems. (I think there's a
philosophical problem -- to me, the split*() functions are purely
syntactical, and the fact that \\foo is not a valid path doesn't mean
that it shouldn't be considered an absolute path.)
Also (quite separately, but strangely related to the philosophical
issue above) fix abspath() so that if win32api exists, it doesn't fail
when the path doesn't actually exist -- if GetFullPathName() fails,
fall back on the old strategy (join with getcwd() if neccessary, and
then use normpath()).
* configure.in, configure, config.h.in, acconfig.h:
For BeOS PowerPC. Chris Herborth.
Mon Apr 5 21:54:14 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Modules/timemodule.c:
Jonathan Giddy notes, and Chris Lawrence agrees, that some comments on
#else/#endif are wrong, and that #if HAVE_TM_ZONE should be #ifdef.
* Misc/ACKS:
Bunch of new contributors, including 9 who contributed to the Docs,
reported by Fred.
Mon Apr 5 18:37:59 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
* Lib/gzip.py:
Oops, missed mode parameter to open().
* Lib/gzip.py:
Made the default mode 'rb' instead of 'r', for better cross-platform
support. (Based on comment on the documentation by Bernhard Reiter
<bernhard@csd.uwm.edu>).
Fri Apr 2 22:18:25 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Tools/scripts/dutree.py:
For reasons I dare not explain, this script should always execute
main() when imported (in other words, it is not usable as a module).
Thu Apr 1 15:32:30 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/test/test_cpickle.py: Jonathan Giddy write:
In test_cpickle.py, the module os got imported, but the line to remove
the temp file has gone missing.
Tue Mar 30 20:17:31 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/BaseHTTPServer.py: Per Cederqvist writes:
If you send something like "PUT / HTTP/1.0" to something derived from
BaseHTTPServer that doesn't define do_PUT, you will get a response
that begins like this:
HTTP/1.0 501 Unsupported method ('do_PUT')
Server: SimpleHTTP/0.3 Python/1.5
Date: Tue, 30 Mar 1999 18:53:53 GMT
The server should complain about 'PUT' instead of 'do_PUT'. This
patch should fix the problem.
Mon Mar 29 20:33:21 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/smtplib.py: Patch by Per Cederqvist, who writes:
"""
- It needlessly used the makefile() method for each response that is
read from the SMTP server.
- If the remote SMTP server closes the connection unexpectedly the
code raised an IndexError. It now raises an SMTPServerDisconnected
exception instead.
- The code now checks that all lines in a multiline response actually
contains an error code.
"""
The Dragon approves.
Mon Mar 29 20:25:40 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
* Lib/compileall.py:
When run as a script, report failures in the exit code as well.
Patch largely based on changes by Andrew Dalke, as discussed in the
distutils-sig.
Mon Mar 29 20:23:41 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/urllib.py:
Hack so that if a 302 or 301 redirect contains a relative URL, the
right thing "just happens" (basejoin() with old URL).
* Modules/cPickle.c:
Protection against picling to/from closed (real) file.
The problem was reported by Moshe Zadka.
* Lib/test/test_cpickle.py:
Test protection against picling to/from closed (real) file.
* Modules/timemodule.c: Chris Lawrence writes:
"""
The GNU folks, in their infinite wisdom, have decided not to implement
altzone in libc6; this would not be horrible, except that timezone
(which is implemented) includes the current DST setting (i.e. timezone
for Central is 18000 in summer and 21600 in winter). So Python's
timezone and altzone variables aren't set correctly during DST.
Here's a patch relative to 1.5.2b2 that (a) makes timezone and altzone
show the "right" thing on Linux (by using the tm_gmtoff stuff
available in BSD, which is how the GLIBC manual claims things should
be done) and (b) should cope with the southern hemisphere. In pursuit
of (b), I also took the liberty of renaming the "summer" and "winter"
variables to "july" and "jan". This patch should also make certain
time calculations on Linux actually work right (like the tz-aware
functions in the rfc822 module).
(It's hard to find DST that's currently being used in the southern
hemisphere; I tested using Africa/Windhoek.)
"""
* Lib/test/output/test_gzip:
Jonathan Giddy discovered this file was missing.
* Modules/shamodule.c:
Avoid warnings from AIX compiler. Reported by Vladimir (AIX is my
middlename) Marangozov, patch coded by Greg Stein.
* Tools/idle/ScriptBinding.py, Tools/idle/PyShell.py:
At Tim Peters' recommendation, add a dummy flush() method to PseudoFile.
Sun Mar 28 17:55:32 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Tools/scripts/ndiff.py: Tim Peters writes:
I should have waited overnight <wink/sigh>. Nothing wrong with the one I
sent, but I couldn't resist going on to add new -r1 / -r2 cmdline options
for recreating the original files from ndiff's output. That's attached, if
you're game! Us Windows guys don't usually have a sed sitting around
<wink>.
Sat Mar 27 13:34:01 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Tools/scripts/ndiff.py: Tim Peters writes:
Attached is a cleaned-up version of ndiff (added useful module
docstring, now echo'ed in case of cmd line mistake); added -q option
to suppress initial file identification lines; + other minor cleanups,
& a slightly faster match engine.
Fri Mar 26 22:36:00 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
* Tools/scripts/dutree.py:
During display, if EPIPE is raised, it's probably because a pager was
killed. Discard the error in that case, but propogate it otherwise.
Fri Mar 26 16:20:45 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/test/output/test_userlist, Lib/test/test_userlist.py:
Test suite for UserList.
* Lib/UserList.py: Use isinstance() where appropriate.
Reformatted with 4-space indent.
Fri Mar 26 16:11:40 1999 Barry Warsaw <bwarsaw@eric.cnri.reston.va.us>
* Tools/pynche/PyncheWidget.py:
Helpwin.__init__(): The text widget should get focus.
* Tools/pynche/pyColorChooser.py:
Removed unnecessary import `from PyncheWidget import PyncheWidget'
Fri Mar 26 15:32:05 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/test/output/test_userdict, Lib/test/test_userdict.py:
Test suite for UserDict
* Lib/UserDict.py: Improved a bunch of things.
The constructor now takes an optional dictionary.
Use isinstance() where appropriate.
Thu Mar 25 22:38:49 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/test/output/test_pickle, Lib/test/output/test_cpickle, Lib/test/test_pickle.py, Lib/test/test_cpickle.py:
Basic regr tests for pickle/cPickle
* Lib/pickle.py:
Don't use "exec" in find_class(). It's slow, unnecessary, and (as AMK
points out) it doesn't work in JPython Applets.
Thu Mar 25 21:50:27 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us>
* Lib/test/test_gzip.py:
Added a simple test suite for gzip. It simply opens a temp file,
writes a chunk of compressed data, closes it, writes another chunk, and
reads the contents back to verify that they are the same.
* Lib/gzip.py:
Based on a suggestion from bruce@hams.com, make a trivial change to
allow using the 'a' flag as a mode for opening a GzipFile. gzip
files, surprisingly enough, can be concatenated and then decompressed;
the effect is to concatenate the two chunks of data.
If we support it on writing, it should also be supported on reading.
This *wasn't* trivial, and required rearranging the code in the
reading path, particularly the _read() method.
Raise IOError instead of RuntimeError in two cases, 'Not a gzipped file'
and 'Unknown compression method'
Thu Mar 25 21:25:01 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/test/test_b1.py:
Add tests for float() and complex() with string args (Nick/Stephanie
Lockwood).
Thu Mar 25 21:21:08 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us>
* Modules/zlibmodule.c:
Add an .unused_data attribute to decompressor objects. If .unused_data
is not an empty string, this means that you have arrived at the
end of the stream of compressed data, and the contents of .unused_data are
whatever follows the compressed stream.
Thu Mar 25 21:16:07 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Python/bltinmodule.c:
Patch by Nick and Stephanie Lockwood to implement complex() with a string
argument. This closes TODO item 2.19.
Wed Mar 24 19:09:00 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Tools/webchecker/wcnew.py: Added Samuel Bayer's new webchecker.
Unfortunately his code breaks wcgui.py in a way that's not easy
to fix. I expect that this is a temporary situation --
eventually Sam's changes will be merged back in.
(The changes add a -t option to specify exceptions to the -x
option, and explicit checking for #foo style fragment ids.)
* Objects/dictobject.c:
Vladimir Marangozov contributed updated comments.
* Objects/bufferobject.c: Folded long lines.
* Lib/test/output/test_sha, Lib/test/test_sha.py:
Added Jeremy's test code for the sha module.
* Modules/shamodule.c, Modules/Setup.in:
Added Greg Stein and Andrew Kuchling's sha module.
Fix comments about zlib version and URL.
* Lib/test/test_bsddb.py: Remove the temp file when we're done.
* Include/pythread.h: Conform to standard boilerplate.
* configure.in, configure, BeOS/linkmodule, BeOS/ar-fake:
Chris Herborth: the new compiler in R4.1 needs some new options to work...
* Modules/socketmodule.c:
Implement two suggestions by Jonathan Giddy: (1) in AIX, clear the
data struct before calling gethostby{name,addr}_r(); (2) ignore the
3/5/6 args determinations made by the configure script and switch on
platform identifiers instead:
AIX, OSF have 3 args
Sun, SGI have 5 args
Linux has 6 args
On all other platforms, undef HAVE_GETHOSTBYNAME_R altogether.
* Modules/socketmodule.c:
Vladimir Marangozov implements the AIX 3-arg gethostbyname_r code.
* Lib/mailbox.py:
Add readlines() to _Subfile class. Not clear who would need it, but
Chris Lawrence sent me a broken version; this one is a tad simpler and
more conforming to the standard.
Tue Mar 23 23:05:34 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us>
* Lib/gzip.py: use struct instead of bit-manipulate in Python
Tue Mar 23 19:00:55 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Modules/Makefile.pre.in:
Add $(EXE) to various occurrences of python so it will work on Cygwin
with egcs (after setting EXE=.exe). Patch by Norman Vine.
* configure, configure.in:
Ack! It never defined HAVE_GETHOSTBYNAME_R so that code was never tested!
Mon Mar 22 22:25:39 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Include/thread.h:
Adding thread.h -- unused but for b/w compatibility.
As requested by Bill Janssen.
* configure.in, configure:
Add code to test for all sorts of gethostbyname_r variants,
donated by David Arnold.
* config.h.in, acconfig.h:
Add symbols for gethostbyname_r variants (sigh).
* Modules/socketmodule.c: Clean up pass for the previous patches.
- Use HAVE_GETHOSTBYNAME_R_6_ARG instead of testing for Linux and
glibc2.
- If gethostbyname takes 3 args, undefine HAVE_GETHOSTBYNAME_R --
don't know what code should be used.
- New symbol USE_GETHOSTBYNAME_LOCK defined iff the lock should be used.
- Modify the gethostbyaddr() code to also hold on to the lock until
after it is safe to release, overlapping with the Python lock.
(Note: I think that it could in theory be possible that Python code
executed while gethostbyname_lock is held could attempt to reacquire
the lock -- e.g. in a signal handler or destructor. I will simply say
"don't do that then.")
* Modules/socketmodule.c: Jonathan Giddy writes:
Here's a patch to fix the race condition, which wasn't fixed by Rob's
patch. It holds the gethostbyname lock until the results are copied out,
which means that this lock and the Python global lock are held at the same
time. This shouldn't be a problem as long as the gethostbyname lock is
always acquired when the global lock is not held.
Mon Mar 22 19:25:30 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us>
* Modules/zlibmodule.c:
Fixed the flush() method of compression objects; the test for
the end of loop was incorrect, and failed when the flushmode != Z_FINISH.
Logic cleaned up and commented.
* Lib/test/test_zlib.py:
Added simple test for the flush() method of compression objects, trying the
different flush values Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FULL_FLUSH.
Mon Mar 22 15:28:08 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/shlex.py:
Bug reported by Tobias Thelen: missing "self." in assignment target.
Fri Mar 19 21:50:11 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Modules/arraymodule.c:
Use an unsigned cast to avoid a warning in VC++.
* Lib/dospath.py, Lib/ntpath.py:
New code for split() by Tim Peters, behaves more like posixpath.split().
* Objects/floatobject.c:
Fix a problem with Vladimir's PyFloat_Fini code: clear the free list; if
a block cannot be freed, add its free items back to the free list.
This is necessary to avoid leaking when Python is reinitialized later.
* Objects/intobject.c:
Fix a problem with Vladimir's PyInt_Fini code: clear the free list; if
a block cannot be freed, add its free items back to the free list, and
add its valid ints back to the small_ints array if they are in range.
This is necessary to avoid leaking when Python is reinitialized later.
* Lib/types.py:
Added BufferType, the type returned by the new builtin buffer(). Greg Stein.
* Python/bltinmodule.c:
New builtin buffer() creates a derived read-only buffer from any
object that supports the buffer interface (e.g. strings, arrays).
* Objects/bufferobject.c:
Added check for negative offset for PyBuffer_FromObject and check for
negative size for PyBuffer_FromMemory. Greg Stein.
Thu Mar 18 15:10:44 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/urlparse.py: Sjoerd Mullender writes:
If a filename on Windows starts with \\, it is converted to a URL
which starts with ////. If this URL is passed to urlparse.urlparse
you get a path that starts with // (and an empty netloc). If you pass
the result back to urlparse.urlunparse, you get a URL that starts with
//, which is parsed differently by urlparse.urlparse. The fix is to
add the (empty) netloc with accompanying slashes if the path in
urlunparse starts with //. Do this for all schemes that use a netloc.
* Lib/nturl2path.py: Sjoerd Mullender writes:
Pathnames of files on other hosts in the same domain
(\\host\path\to\file) are not translated correctly to URLs and back.
The URL should be something like file:////host/path/to/file.
Note that a combination of drive letter and remote host is not
possible.
Wed Mar 17 22:30:10 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/urlparse.py:
Delete non-standard-conforming code in urljoin() that would use the
netloc from the base url as the default netloc for the resulting url
even if the schemes differ.
Once upon a time, when the web was wild, this was a valuable hack
because some people had a URL referencing an ftp server colocated with
an http server without having the host in the ftp URL (so they could
replicate it or change the hostname easily).
More recently, after the file: scheme got added back to the list of
schemes that accept a netloc, it turns out that this caused weirdness
when joining an http: URL with a file: URL -- the resulting file: URL
would always inherit the host from the http: URL because the file:
scheme supports a netloc but in practice never has one.
There are two reasons to get rid of the old, once-valuable hack,
instead of removing the file: scheme from the uses_netloc list. One,
the RFC says that file: uses the netloc syntax, and does not endorse
the old hack. Two, neither netscape 4.5 nor IE 4.0 support the old
hack.
* Include/ceval.h, Include/abstract.h:
Add DLL level b/w compat for PySequence_In and PyEval_CallObject
Tue Mar 16 21:54:50 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/lib-tk/Tkinter.py: Bug reported by Jim Robinson:
An attempt to execute grid_slaves with arguments (0,0) results in
*all* of the slaves being returned, not just the slave associated with
row 0, column 0. This is because the test for arguments in the method
does not test to see if row (and column) does not equal None, but
rather just whether is evaluates to non-false. A value of 0 fails
this test.
Tue Mar 16 14:17:48 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
* Modules/cmathmodule.c:
Docstring fix: acosh() returns the hyperbolic arccosine, not the
hyperbolic cosine. Problem report via David Ascher by one of his
students.
Mon Mar 15 21:40:59 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* configure.in:
Should test for gethost*by*name_r, not for gethostname_r (which
doesn't exist and doesn't make sense).
* Modules/socketmodule.c:
Patch by Rob Riggs for Linux -- glibc2 has a different argument
converntion for gethostbyname_r() etc. than Solaris!
* Python/thread_pthread.h: Rob Riggs wrote:
"""
Spec says that on success pthread_create returns 0. It does not say
that an error code will be < 0. Linux glibc2 pthread_create() returns
ENOMEM (12) when one exceed process limits. (It looks like it should
return EAGAIN, but that's another story.)
For reference, see:
http://www.opengroup.org/onlinepubs/7908799/xsh/pthread_create.html
"""
[I have a feeling that similar bugs were fixed before; perhaps someone
could check that all error checks no check for != 0?]
* Tools/bgen/bgen/bgenObjectDefinition.py:
New mixin class that defines cmp and hash that use
the ob_itself pointer. This allows (when using the mixin)
different Python objects pointing to the same C object and
behaving well as dictionary keys.
Or so sez Jack Jansen...
* Lib/urllib.py: Yet another patch by Sjoerd Mullender:
Don't convert URLs to URLs using pathname2url.
Fri Mar 12 22:15:43 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/cmd.py: Patch by Michael Scharf. He writes:
The module cmd requires for each do_xxx command a help_xxx
function. I think this is a little old fashioned.
Here is a patch: use the docstring as help if no help_xxx
function can be found.
[I'm tempted to rip out all the help_* functions from pdb, but I'll
resist it. Any takers? --Guido]
* Tools/freeze/freeze.py: Bug submitted by Wayne Knowles, who writes:
Under Windows, python freeze.py -o hello hello.py
creates all the correct files in the hello subdirectory, but the
Makefile has the directory prefix in it for frozen_extensions.c
nmake fails because it tries to locate hello/frozen_extensions.c
(His fix adds a call to os.path.basename() in the appropriate place.)
* Objects/floatobject.c, Objects/intobject.c:
Vladimir has restructured his code somewhat so that the blocks are now
represented by an explicit structure. (There are still too many casts
in the code, but that may be unavoidable.)
Also added code so that with -vv it is very chatty about what it does.
* Demo/zlib/zlibdemo.py, Demo/zlib/minigzip.py:
Change #! line to modern usage; also chmod +x
* Demo/pdist/rrcs, Demo/pdist/rcvs, Demo/pdist/rcsbump:
Change #! line to modern usage
* Lib/nturl2path.py, Lib/urllib.py: From: Sjoerd Mullender
The filename to URL conversion didn't properly quote special
characters.
The URL to filename didn't properly unquote special chatacters.
* Objects/floatobject.c:
OK, try again. Vladimir gave me a fix for the alignment bus error,
so here's his patch again. This time it works (at least on Solaris,
Linux and Irix).
Thu Mar 11 23:21:23 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Tools/idle/PathBrowser.py:
Don't crash when sys.path contains an empty string.
* Tools/idle/PathBrowser.py:
- Don't crash in the case where a superclass is a string instead of a
pyclbr.Class object; this can happen when the superclass is
unrecognizable (to pyclbr), e.g. when module renaming is used.
- Show a watch cursor when calling pyclbr (since it may take a while
recursively parsing imported modules!).
Thu Mar 11 16:04:04 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
* Lib/mimetypes.py:
Added .rdf and .xsl as application/xml types. (.rdf is for the
Resource Description Framework, a metadata encoding, and .xsl is for
the Extensible Stylesheet Language.)
Thu Mar 11 13:26:23 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/test/output/test_popen2, Lib/test/test_popen2.py:
Test for popen2 module, by Chris Tismer.
* Objects/floatobject.c:
Alas, Vladimir's patch caused a bus error (probably double
alignment?), and I didn't test it. Withdrawing it for now.
Wed Mar 10 22:55:47 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Objects/floatobject.c:
Patch by Vladimir Marangoz to allow freeing of the allocated blocks of
floats on finalization.
* Objects/intobject.c:
Patch by Vladimir Marangoz to allow freeing of the allocated blocks of
integers on finalization.
* Tools/idle/EditorWindow.py, Tools/idle/Bindings.py:
Add PathBrowser to File module
* Tools/idle/PathBrowser.py:
"Path browser" - 4 scrolled lists displaying:
directories on sys.path
modules in selected directory
classes in selected module
methods of selected class
Sinlge clicking in a directory, module or class item updates the next
column with info about the selected item. Double clicking in a
module, class or method item opens the file (and selects the clicked
item if it is a class or method).
I guess eventually I should be using a tree widget for this, but the
ones I've seen don't work well enough, so for now I use the old
Smalltalk or NeXT style multi-column hierarchical browser.
* Tools/idle/MultiScrolledLists.py:
New utility: multiple scrolled lists in parallel
* Tools/idle/ScrolledList.py: - White background.
- Display "(None)" (or text of your choosing) when empty.
- Don't set the focus.
Tue Mar 9 19:31:21 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/urllib.py:
open_http also had the 'data is None' test backwards. don't call with the
extra argument if data is None.
* Demo/embed/demo.c:
Call Py_SetProgramName() instead of redefining getprogramname(),
reflecting changes in the runtime around 1.5 or earlier.
* Python/ceval.c:
Always test for an error return (usually NULL or -1) without setting
an exception.
* Modules/timemodule.c: Patch by Chris Herborth for BeOS code.
He writes:
I had an off-by-1000 error in floatsleep(),
and the problem with time.clock() is that it's not implemented properly
on QNX... ANSI says it's supposed to return _CPU_ time used by the
process, but on QNX it returns the amount of real time used... so I was
confused.
* Tools/bgen/bgen/macsupport.py: Small change by Jack Jansen.
Test for self.returntype behaving like OSErr rather than being it.
Thu Feb 25 16:14:58 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us>
* Lib/urllib.py:
http_error had the 'data is None' test backwards. don't call with the
extra argument if data is None.
* Lib/urllib.py: change indentation from 8 spaces to 4 spaces
* Lib/urllib.py: pleasing the tabnanny
Thu Feb 25 14:26:02 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
* Lib/colorsys.py:
Oops, one more "x, y, z" to convert...
* Lib/colorsys.py:
Adjusted comment at the top to be less confusing, following Fredrik
Lundh's example.
Converted comment to docstring.
Wed Feb 24 18:49:15 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
* Lib/toaiff.py:
Use sndhdr instead of the obsolete whatsound module.
Wed Feb 24 18:42:38 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us>
* Lib/urllib.py:
When performing a POST request, i.e. when the second argument to
urlopen is used to specify form data, make sure the second argument is
threaded through all of the http_error_NNN calls. This allows error
handlers like the redirect and authorization handlers to properly
re-start the connection.
Wed Feb 24 16:25:17 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/mhlib.py: Patch by Lars Wirzenius:
o the initial comment is wrong: creating messages is already
implemented
o Message.getbodytext: if the mail or it's part contains an
empty content-transfer-encoding header, the code used to
break; the change below treats an empty encoding value the same
as the other types that do not need decoding
o SubMessage.getbodytext was missing the decode argument; the
change below adds it; I also made it unconditionally return
the raw text if decoding was not desired, because my own
routines needed that (and it was easier than rewriting my
own routines ;-)
Wed Feb 24 00:35:43 1999 Barry Warsaw <bwarsaw@eric.cnri.reston.va.us>
* Python/bltinmodule.c (initerrors):
Make sure that the exception tuples ("base-classes" when
string-based exceptions are used) reflect the real class hierarchy,
i.e. that SystemExit derives from Exception not StandardError.
* Lib/exceptions.py:
Document the correct class hierarchy for SystemExit. It is not an
error and so it derives from Exception and not SystemError. The
docstring was incorrect but the implementation was fine.
Tue Feb 23 23:07:51 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/shutil.py:
Add import sys, needed by reference to sys.exc_info() in rmtree().
Discovered by Mitch Chapman.
* config.h.in:
Now that we don't have AC_CHECK_LIB(m, pow), the HAVE_LIBM symbol
disappears. It wasn't used anywhere anyway...
* Modules/arraymodule.c:
Carefully check for overflow when allocating the memory for fromfile
-- someone tried to pass in sys.maxint and got bitten by the bogus
calculations.
* configure.in:
Get rid of AC_CHECK_LIB(m, pow) since this is taken care of later with
LIBM (from --with-libm=...); this actually broke the customizability
offered by the latter option. Thanks go to Clay Spence for reporting
this.
* Lib/test/test_dl.py:
1. Print the error message (carefully) when a dl.open() fails in verbose mode.
2. When no test case worked, raise ImportError instead of failing.
* Python/bltinmodule.c:
Patch by Tim Peters to improve the range checks for range() and
xrange(), especially for platforms where int and long are different
sizes (so sys.maxint isn't actually the theoretical limit for the
length of a list, but the largest C int is -- sys.maxint is the
largest Python int, which is actually a C long).
* Makefile.in:
1. Augment the DG/UX rule so it doesn't break the BeOS build.
2. Add $(EXE) to various occurrences of python so it will work on
Cygwin with egcs (after setting EXE=.exe). These patches by
Norman Vine.
* Lib/posixfile.py:
According to Jeffrey Honig, bsd/os 2.0 - 4.0 should be added to the
list (of bsd variants that have a different lock structure).
* Lib/test/test_fcntl.py:
According to Jeffrey Honig, bsd/os 4.0 should be added to the list.
* Modules/timemodule.c:
Patch by Tadayoshi Funaba (with some changes) to be smarter about
guessing what happened when strftime() returns 0. Is it buffer
overflow or was the result simply 0 bytes long? (This happens for an
empty format string, or when the format string is a single %Z and the
timezone is unknown.) if the buffer is at least 256 times as long as
the format, assume the latter.
Mon Feb 22 19:01:42 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/urllib.py:
As Des Barry points out, we need to call pathname2url(file) in two
calls to addinfourl() in open_file().
* Modules/Setup.in: Document *static* -- in two places!
* Modules/timemodule.c:
We don't support leap seconds, so the seconds field of a time 9-tuple
should be in the range [0-59]. Noted by Tadayoshi Funaba.
* Modules/stropmodule.c:
In atoi(), don't use isxdigit() to test whether the last character
converted was a "digit" -- use isalnum(). This test is there only to
guard against "+" or "-" being interpreted as a valid int literal.
Reported by Takahiro Nakayama.
* Lib/os.py:
As Finn Bock points out, _P_WAIT etc. don't have a leading underscore
so they don't need to be treated specially here.
Mon Feb 22 15:38:58 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
* Misc/NEWS:
Typo: "apparentlt" --> "apparently"
Mon Feb 22 15:38:46 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
* Lib/urlparse.py: Steve Clift pointed out that 'file' allows a netloc.
* Modules/posixmodule.c:
The docstring for ttyname(..) claims a second "mode" argument. The
actual code does not allow such an argument. (Finn Bock.)
* Lib/lib-old/poly.py:
Dang. Even though this is obsolete code, somebody found a bug, and I
fix it. Oh well.
Thu Feb 18 20:51:50 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
* Lib/pyclbr.py:
Bow to font-lock at the end of the docstring, since it throws stuff
off.
Make sure the path paramter to readmodule() is a list before adding it
with sys.path, or the addition could fail.
======================================================================
From 1.5.2b1 to 1.5.2b2
=======================
General
-------
- Many memory leaks fixed.
- Many small bugs fixed.
- Command line option -OO (or -O -O) suppresses inclusion of doc
strings in resulting bytecode.
Windows-specific changes
------------------------
- New built-in module winsound provides an interface to the Win32
PlaySound() call.
- Re-enable the audioop module in the config.c file.
- On Windows, support spawnv() and associated P_* symbols.
- Fixed the conversion of times() return values on Windows.
- Removed freeze from the installer -- it doesn't work without the
source tree. (See FAQ 8.11.)
- On Windows 95/98, the Tkinter module now is smart enough to find
Tcl/Tk even when the PATH environment variable hasn't been set -- when
the import of _tkinter fails, it searches in a standard locations,
patches os.environ["PATH"], and tries again. When it still fails, a
clearer error message is produced. This should avoid most
installation problems with Tkinter use (e.g. in IDLE).
- The -i option doesn't make any calls to set[v]buf() for stdin --
this apparently screwed up _kbhit() and the _tkinter main loop.
- The ntpath module (and hence, os.path on Windows) now parses out UNC
paths (e.g. \\host\mountpoint\dir\file) as "drive letters", so that
splitdrive() will \\host\mountpoint as the drive and \dir\file as the
path. ** EXPERIMENTAL **
- Added a hack to the exit code so that if (1) the exit status is
nonzero and (2) we think we have our own DOS box (i.e. we're not
started from a command line shell), we print a message and wait for
the user to hit a key before the DOS box is closed.
- Updated the installer to WISE 5.0g. Added a dialog warning about
the imminent Tcl installation. Added a dialog to specify the program
group name in the start menu. Upgraded the Tcl installer to Tcl
8.0.4.
Changes to intrinsics
---------------------
- The repr() or str() of a module object now shows the __file__
attribute (i.e., the file which it was loaded), or the string
"(built-in)" if there is no __file__ attribute.
- The range() function now avoids overflow during its calculations (if
at all possible).
- New info string sys.hexversion, which is an integer encoding the
version in hexadecimal. In other words, hex(sys.hexversion) ==
0x010502b2 for Python 1.5.2b2.
New or improved ports
---------------------
- Support for Nextstep descendants (future Mac systems).
- Improved BeOS support.
- Support dynamic loading of shared libraries on NetBSD platforms that
use ELF (i.e., MIPS and Alpha systems).
Configuration/build changes
---------------------------
- The Lib/test directory is no longer included in the default module
search path (sys.path) -- "test" has been a package ever since 1.5.
- Now using autoconf 2.13.
New library modules
-------------------
- New library modules asyncore and asynchat: these form Sam Rushing's
famous asynchronous socket library. Sam has gracefully allowed me to
incorporate these in the standard Python library.
- New module statvfs contains indexing constants for [f]statvfs()
return tuple.
Changes to the library
----------------------
- The wave module (platform-independent support for Windows sound
files) has been fixed to actually make it work.
- The sunau module (platform-independent support for Sun/NeXT sound
files) has been fixed to work across platforms. Also, a weird
encoding bug in the header of the audio test data file has been
corrected.
- Fix a bug in the urllib module that occasionally tripped up
webchecker and other ftp retrieves.
- ConfigParser's get() method now accepts an optional keyword argument
(vars) that is substituted on top of the defaults that were setup in
__init__. You can now also have recusive references in your
configuration file.
- Some improvements to the Queue module, including a put_nowait()
module and an optional "block" second argument, to get() and put(),
defaulting to 1.
- The updated xmllib module is once again compatible with the version
present in Python 1.5.1 (this was accidentally broken in 1.5.2b1).
- The bdb module (base class for the debugger) now supports
canonicalizing pathnames used in breakpoints. The derived class must
override the new canonical() method for this to work. Also changed
clear_break() to the backwards compatible old signature, and added
clear_bpbynumber() for the new functionality.
- In sgmllib (and hence htmllib), recognize attributes even if they
don't have space in front of them. I.e. '<a
name="foo"href="bar.html">' will now have two attributes recognized.
- In the debugger (pdb), change clear syntax to support three
alternatives: clear; clear file:line; clear bpno bpno ...
- The os.path module now pretends to be a submodule within the os
"package", so you can do things like "from os.path import exists".
- The standard exceptions now have doc strings.
- In the smtplib module, exceptions are now classes. Also avoid
inserting a non-standard space after "TO" in rcpt() command.
- The rfc822 module's getaddrlist() method now uses all occurrences of
the specified header instead of just the first. Some other bugfixes
too (to handle more weird addresses found in a very large test set,
and to avoid crashes on certain invalid dates), and a small test
module has been added.
- Fixed bug in urlparse in the common-case code for HTTP URLs; it
would lose the query, fragment, and/or parameter information.
- The sndhdr module no longer supports whatraw() -- it depended on a
rare extenral program.
- The UserList module/class now supports the extend() method, like
real list objects.
- The uu module now deals better with trailing garbage generated by
some broke uuencoders.
- The telnet module now has an my_interact() method which uses threads
instead of select. The interact() method uses this by default on
Windows (where the single-threaded version doesn't work).
- Add a class to mailbox.py for dealing with qmail directory
mailboxes. The test code was extended to notice these being used as
well.
Changes to extension modules
----------------------------
- Support for the [f]statvfs() system call, where it exists.
- Fixed some bugs in cPickle where bad input could cause it to dump
core.
- Fixed cStringIO to make the writelines() function actually work.
- Added strop.expandtabs() so string.expandtabs() is now much faster.
- Added fsync() and fdatasync(), if they appear to exist.
- Support for "long files" (64-bit seek pointers).
- Fixed a bug in the zlib module's flush() function.
- Added access() system call. It returns 1 if access granted, 0 if
not.
- The curses module implements an optional nlines argument to
w.scroll(). (It then calls wscrl(win, nlines) instead of scoll(win).)
Changes to tools
----------------
- Some changes to IDLE; see Tools/idle/NEWS.txt.
- Latest version of Misc/python-mode.el included.
Changes to Tkinter
------------------
- Avoid tracebacks when an image is deleted after its root has been
destroyed.
Changes to the Python/C API
---------------------------
- When parentheses are used in a PyArg_Parse[Tuple]() call, any
sequence is now accepted, instead of requiring a tuple. This is in
line with the general trend towards accepting arbitrary sequences.
- Added PyModule_GetFilename().
- In PyNumber_Power(), remove unneeded and even harmful test for float
to the negative power (which is already and better done in
floatobject.c).
- New version identification symbols; read patchlevel.h for info. The
version numbers are now exported by Python.h.
- Rolled back the API version change -- it's back to 1007!
- The frozenmain.c function calls PyInitFrozenExtensions().
- Added 'N' format character to Py_BuildValue -- like 'O' but doesn't
INCREF.
======================================================================
From 1.5.2a2 to 1.5.2b1
=======================
Changes to intrinsics
---------------------
- New extension NotImplementedError, derived from RuntimeError. Not
used, but recommended use is for "abstract" methods to raise this.
- The parser will now spit out a warning or error when -t or -tt is
used for parser input coming from a string, too.
- The code generator now inserts extra SET_LINENO opcodes when
compiling multi-line argument lists.
- When comparing bound methods, use identity test on the objects, not
equality test.
New or improved ports
---------------------
- Chris Herborth has redone his BeOS port; it now works on PowerPC
(R3/R4) and x86 (R4 only). Threads work too in this port.
Renaming
--------
- Thanks to Chris Herborth, the thread primitives now have proper Py*
names in the source code (they already had those for the linker,
through some smart macros; but the source still had the old, un-Py
names).
Configuration/build changes
---------------------------
- Improved support for FreeBSD/3.
- Check for pthread_detach instead of pthread_create in libc.
- The makesetup script now searches EXECINCLUDEPY before INCLUDEPY.
- Misc/Makefile.pre.in now also looks at Setup.thread and Setup.local.
Otherwise modules such as thread didn't get incorporated in extensions.
New library modules
-------------------
- shlex.py by Eric Raymond provides a lexical analyzer class for
simple shell-like syntaxes.
- netrc.py by Eric Raymond provides a parser for .netrc files. (The
undocumented Netrc class in ftplib.py is now obsolete.)
- codeop.py is a new module that contains the compile_command()
function that was previously in code.py. This is so that JPython can
provide its own version of this function, while still sharing the
higher-level classes in code.py.
- turtle.py is a new module for simple turtle graphics. I'm still
working on it; let me know if you use this to teach Python to children
or other novices without prior programming experience.
Obsoleted library modules
-------------------------
- poly.py and zmod.py have been moved to Lib/lib-old to emphasize
their status of obsoleteness. They don't do a particularly good job
and don't seem particularly relevant to the Python core.
New tools
---------
- I've added IDLE: my Integrated DeveLopment Environment for Python.
Requires Tcl/Tk (and Tkinter). Works on Windows and Unix (and should
work on Macintosh, but I haven't been able to test it there; it does
depend on new features in 1.5.2 and perhaps even new features in
1.5.2b1, especially the new code module). This is very much a work in
progress. I'd like to hear how people like it compared to PTUI (or
any other IDE they are familiar with).
- New tools by Barry Warsaw:
= audiopy: controls the Solaris Audio device
= pynche: The PYthonically Natural Color and Hue Editor
= world: Print mappings between country names and DNS country codes
New demos
---------
- Demo/scripts/beer.py prints the lyrics to an arithmetic drinking
song.
- Demo/tkinter/guido/optionmenu.py shows how to do an option menu in
Tkinter. (By Fredrik Lundh -- not by me!)
Changes to the library
----------------------
- compileall.py now avoids recompiling .py files that haven't changed;
it adds a -f option to force recompilation.
- New version of xmllib.py by Sjoerd Mullender (0.2 with latest
patches).
- nntplib.py: statparse() no longer lowercases the message-id.
- types.py: use type(__stdin__) for FileType.
- urllib.py: fix translations for filenames with "funny" characters.
Patch by Sjoerd Mullender. Note that if you subclass one of the
URLopener classes, and you have copied code from the old urllib.py,
your subclass may stop working. A long-term solution is to provide
more methods so that you don't have to copy code.
- cgi.py: In read_multi, allow a subclass to override the class we
instantiate when we create a recursive instance, by setting the class
variable 'FieldStorageClass' to the desired class. By default, this
is set to None, in which case we use self.__class__ (as before).
Also, a patch by Jim Fulton to pass additional arguments to recursive
calls to the FieldStorage constructor from its read_multi method.
- UserList.py: In __getslice__, use self.__class__ instead of
UserList.
- In SimpleHTTPServer.py, the server specified in test() should be
BaseHTTPServer.HTTPServer, in case the request handler should want to
reference the two attributes added by BaseHTTPServer.server_bind. (By
Jeff Rush, for Bobo). Also open the file in binary mode, so serving
images from a Windows box might actually work.
- In CGIHTTPServer.py, the list of acceptable formats is -split-
on spaces but -joined- on commas, resulting in double commas
in the joined text. (By Jeff Rush.)
- SocketServer.py, patch by Jeff Bauer: a minor change to declare two
new threaded versions of Unix Server classes, using the ThreadingMixIn
class: ThreadingUnixStreamServer, ThreadingUnixDatagramServer.
- bdb.py: fix bomb on deleting a temporary breakpoint: there's no
method do_delete(); do_clear() was meant. By Greg Ward.
- getopt.py: accept a non-list sequence for the long options (request
by Jack Jansen). Because it might be a common mistake to pass a
single string, this situation is treated separately. Also added
docstrings (copied from the library manual) and removed the (now
redundant) module comments.
- tempfile.py: improvements to avoid security leaks.
- code.py: moved compile_command() to new module codeop.py.
- pickle.py: support pickle format 1.3 (binary float added). By Jim
Fulton. Also get rid of the undocumented obsolete Pickler dump_special
method.
- uu.py: Move 'import sys' to top of module, as noted by Tim Peters.
- imaplib.py: fix problem with some versions of IMAP4 servers that
choose to mix the case in their CAPABILITIES response.
- cmp.py: use (f1, f2) as cache key instead of f1 + ' ' + f2. Noted
by Fredrik Lundh.
Changes to extension modules
----------------------------
- More doc strings for several modules were contributed by Chris
Petrilli: math, cmath, fcntl.
- Fixed a bug in zlibmodule.c that could cause core dumps on
decompression of rarely occurring input.
- cPickle.c: new version from Jim Fulton, with Open Source copyright
notice. Also, initialize self->safe_constructors early on to prevent
crash in early dealloc.
- cStringIO.c: new version from Jim Fulton, with Open Source copyright
notice. Also fixed a core dump in cStringIO.c when doing seeks.
- mpzmodule.c: fix signed character usage in mpz.mpz(stringobjecty).
- readline.c: Bernard Herzog pointed out that rl_parse_and_bind
modifies its argument string (bad function!), so we make a temporary
copy.
- sunaudiodev.c: Barry Warsaw added more smarts to get the device and
control pseudo-device, per audio(7I).
Changes to tools
----------------
- New, improved version of Barry Warsaw's Misc/python-mode.el (editing
support for Emacs).
- tabnanny.py: added a -q ('quiet') option to tabnanny, which causes
only the names of offending files to be printed.
- freeze: when printing missing modules, also print the module they
were imported from.
- untabify.py: patch by Detlef Lannert to implement -t option
(set tab size).
Changes to Tkinter
------------------
- grid_bbox(): support new Tk API: grid bbox ?column row? ?column2
row2?
- _tkinter.c: RajGopal Srinivasan noted that the latest code (1.5.2a2)
doesn't work when running in a non-threaded environment. He added
some #ifdefs that fix this.
Changes to the Python/C API
---------------------------
- Bumped API version number to 1008 -- enough things have changed!
- There's a new macro, PyThreadState_GET(), which does the same work
as PyThreadState_Get() without the overhead of a function call (it
also avoids the error check). The two top calling locations of
PyThreadState_Get() have been changed to use this macro.
- All symbols intended for export from a DLL or shared library are now
marked as such (with the DL_IMPORT() macro) in the header file that
declares them. This was needed for the BeOS port, and should also
make some other ports easier. The PC port no longer needs the file
with exported symbols (PC/python_nt.def). There's also a DL_EXPORT
macro which is only used for init methods in extension modules, and
for Py_Main().
Invisible changes to internals
------------------------------
- Fixed a bug in new_buffersize() in fileobject.c which could
return a buffer size that was way too large.
- Use PySys_WriteStderr instead of fprintf in most places.
- dictobject.c: remove dead code discovered by Vladimir Marangozov.
- tupleobject.c: make tuples less hungry -- an extra item was
allocated but never used. Tip by Vladimir Marangozov.
- mymath.h: Metrowerks PRO4 finally fixes the hypot snafu. (Jack
Jansen)
- import.c: Jim Fulton fixes a reference count bug in
PyEval_GetGlobals.
- glmodule.c: check in the changed version after running the stubber
again -- this solves the conflict with curses over the 'clear' entry
point much nicer. (Jack Jansen had checked in the changes to cstubs
eons ago, but I never regenrated glmodule.c :-( )
- frameobject.c: fix reference count bug in PyFrame_New. Vladimir
Marangozov.
- stropmodule.c: add a missing DECREF in an error exit. Submitted by
Jonathan Giddy.
======================================================================
From 1.5.2a1 to 1.5.2a2
=======================
General
-------
- It is now a syntax error to have a function argument without a
default following one with a default.
- __file__ is now set to the .py file if it was parsed (it used to
always be the .pyc/.pyo file).
- Don't exit with a fatal error during initialization when there's a
problem with the exceptions.py module.
- New environment variable PYTHONOPTIMIZE can be used to set -O.
- New version of python-mode.el for Emacs.
Miscellaneous fixed bugs
------------------------
- No longer print the (confusing) error message about stack underflow
while compiling.
- Some threading and locking bugs fixed.
- When errno is zero, report "Error", not "Success".
Documentation
-------------
- Documentation will be released separately.
- Doc strings added to array and md5 modules by Chris Petrilli.
Ports and build procedure
-------------------------
- Stop installing when a move or copy fails.
- New version of the OS/2 port code by Jeff Rush.
- The makesetup script handles absolute filenames better.
- The 'new' module is now enabled by default in the Setup file.
- I *think* I've solved the problem with the Linux build blowing up
sometimes due to a conflict between sigcheck/intrcheck and
signalmodule.
Built-in functions
------------------
- The second argument to apply() can now be any sequence, not just a
tuple.
Built-in types
--------------
- Lists have a new method: L1.extend(L2) is equivalent to the common
idiom L1[len(L1):] = L2.
- Better error messages when a sequence is indexed with a non-integer.
- Bettter error message when calling a non-callable object (include
the type in the message).
Python services
---------------
- New version of cPickle.c fixes some bugs.
- pickle.py: improved instantiation error handling.
- code.py: reworked quite a bit. New base class
InteractiveInterpreter and derived class InteractiveConsole. Fixed
several problems in compile_command().
- py_compile.py: print error message and continue on syntax errors.
Also fixed an old bug with the fstat code (it was never used).
- pyclbr.py: support submodules of packages.
String Services
---------------
- StringIO.py: raise the right exception (ValueError) for attempted
I/O on closed StringIO objects.
- re.py: fixed a bug in subn(), which caused .groups() to fail inside
the replacement function called by sub().
- The struct module has a new format 'P': void * in native mode.
Generic OS Services
-------------------
- Module time: Y2K robustness. 2-digit year acceptance depends on
value of time.accept2dyear, initialized from env var PYTHONY2K,
default 0. Years 00-68 mean 2000-2068, while 69-99 mean 1969-1999
(POSIX or X/Open recommendation).
- os.path: normpath(".//x") should return "x", not "/x".
- getpass.py: fall back on default_getpass() when sys.stdin.fileno()
doesn't work.
- tempfile.py: regenerate the template after a fork() call.
Optional OS Services
--------------------
- In the signal module, disable restarting interrupted system calls
when we have siginterrupt().
Debugger
--------
- No longer set __args__; this feature is no longer supported and can
affect the debugged code.
- cmd.py, pdb.py and bdb.py have been overhauled by Richard Wolff, who
added aliases and some other useful new features, e.g. much better
breakpoint support: temporary breakpoint, disabled breakpoints,
breakpoints with ignore counts, and conditions; breakpoints can be set
on a file before it is loaded.
Profiler
--------
- Changes so that JPython can use it. Also fix the calibration code
so it actually works again
.
Internet Protocols and Support
------------------------------
- imaplib.py: new version from Piers Lauder.
- smtplib.py: change sendmail() method to accept a single string or a
list or strings as the destination (commom newbie mistake).
- poplib.py: LIST with a msg argument fixed.
- urlparse.py: some optimizations for common case (http).
- urllib.py: support content-length in info() for ftp protocol;
support for a progress meter through a third argument to
urlretrieve(); commented out gopher test (the test site is dead).
Internet Data handling
----------------------
- sgmllib.py: support tags with - or . in their name.
- mimetypes.py: guess_type() understands 'data' URLs.
Restricted Execution
--------------------
- The classes rexec.RModuleLoader and rexec.RModuleImporter no
longer exist.
Tkinter
-------
- When reporting an exception, store its info in sys.last_*. Also,
write all of it to stderr.
- Added NS, EW, and NSEW constants, for grid's sticky option.
- Fixed last-minute bug in 1.5.2a1 release: need to include "mytime.h".
- Make bind variants without a sequence return a tuple of sequences
(formerly it returned a string, which wasn't very convenient).
- Add image commands to the Text widget (these are new in Tk 8.0).
- Added new listbox and canvas methods: {xview,yview}_{scroll,moveto}.)
- Improved the thread code (but you still can't call update() from
another thread on Windows).
- Fixed unnecessary references to _default_root in the new dialog
modules.
- Miscellaneous problems fixed.
Windows General
---------------
- Call LoadLibraryEx(..., ..., LOAD_WITH_ALTERED_SEARCH_PATH) to
search for dependent dlls in the directory containing the .pyd.
- In debugging mode, call DebugBreak() in Py_FatalError().
Windows Installer
-----------------
- Install zlib.dll in the DLLs directory instead of in the win32
system directory, to avoid conflicts with other applications that have
their own zlib.dll.
Test Suite
----------
- test_long.py: new test for long integers, by Tim Peters.
- regrtest.py: improved so it can be used for other test suites as
well.
- test_strftime.py: use re to compare test results, to support legal
variants (e.g. on Linux).
Tools and Demos
---------------
- Four new scripts in Tools/scripts: crlf.py and lfcr.py (to
remove/add Windows style '\r\n' line endings), untabify.py (to remove
tabs), and rgrep.yp (reverse grep).
- Improvements to Tools/freeze/. Each Python module is now written to
its own C file. This prevents some compilers or assemblers from
blowing up on large frozen programs, and saves recompilation time if
only a few modules are changed. Other changes too, e.g. new command
line options -x and -i.
- Much improved (and smaller!) version of Tools/scripts/mailerdaemon.py.
Python/C API
------------
- New mechanism to support extensions of the type object while
remaining backward compatible with extensions compiled for previous
versions of Python 1.5. A flags field indicates presence of certain
fields.
- Addition to the buffer API to differentiate access to bytes and
8-bit characters (in anticipation of Unicode characters).
- New argument parsing format t# ("text") to indicate 8-bit
characters; s# simply means 8-bit bytes, for backwards compatibility.
- New object type, bufferobject.c is an example and can be used to
create buffers from memory.
- Some support for 64-bit longs, including some MS platforms.
- Many calls to fprintf(stderr, ...) have been replaced with calls to
PySys_WriteStderr(...).
- The calling context for PyOS_Readline() has changed: it must now be
called with the interpreter lock held! It releases the lock around
the call to the function pointed to by PyOS_ReadlineFunctionPointer
(default PyOS_StdioReadline()).
- New APIs PyLong_FromVoidPtr() and PyLong_AsVoidPtr().
- Renamed header file "thread.h" to "pythread.h".
- The code string of code objects may now be anything that supports the
buffer API.
======================================================================
From 1.5.1 to 1.5.2a1
=====================
General
-------
- When searching for the library, a landmark that is a compiled module
(string.pyc or string.pyo) is also accepted.
- When following symbolic links to the python executable, use a loop
so that a symlink to a symlink can work.
- Added a hack so that when you type 'quit' or 'exit' at the
interpreter, you get a friendly explanation of how to press Ctrl-D (or
Ctrl-Z) to exit.
- New and improved Misc/python-mode.el (Python mode for Emacs).
- Revert a new feature in Unix dynamic loading: for one or two
revisions, modules were loaded using the RTLD_GLOBAL flag. It turned
out to be a bad idea.
Miscellaneous fixed bugs
------------------------
- All patches on the patch page have been integrated. (But much more
has been done!)
- Several memory leaks plugged (e.g. the one for classes with a
__getattr__ method).
- Removed the only use of calloc(). This triggered an obscure bug on
multiprocessor Sparc Solaris 2.6.
- Fix a peculiar bug that would allow "import sys.time" to succeed
(believing the built-in time module to be a part of the sys package).
- Fix a bug in the overflow checking when converting a Python long to
a C long (failed to convert -2147483648L, and some other cases).
Documentation
-------------
- Doc strings have been added to many extension modules: __builtin__,
errno, select, signal, socket, sys, thread, time. Also to methods of
list objects (try [].append.__doc__). A doc string on a type will now
automatically be propagated to an instance if the instance has methods
that are accessed in the usual way.
- The documentation has been expanded and the formatting improved.
(Remember that the documentation is now unbundled and has its own
release cycle though; see http://www.python.org/doc/.)
- Added Misc/Porting -- a mini-FAQ on porting to a new platform.
Ports and build procedure
-------------------------
- The BeOS port is now integrated. Courtesy Chris Herborth.
- Symbol files for FreeBSD 2.x and 3.x have been contributed
(Lib/plat-freebsd[23]/*).
- Support HPUX 10.20 DCE threads.
- Finally fixed the configure script so that (on SGI) if -OPT:Olimit=0
works, it won't also use -Olimit 1500 (which gives a warning for every
file). Also support the SGI_ABI environment variable better.
- The makesetup script now understands absolute pathnames ending in .o
in the module -- it assumes it's a file for which we have no source.
- Other miscellaneous improvements to the configure script and
Makefiles.
- The test suite now uses a different sound sample.
Built-in functions
------------------
- Better checks for invalid input to int(), long(), string.atoi(),
string.atol(). (Formerly, a sign without digits would be accepted as
a legal ways to spell zero.)
- Changes to map() and filter() to use the length of a sequence only
as a hint -- if an IndexError happens earlier, take that. (Formerly,
this was considered an error.)
- Experimental feature in getattr(): a third argument can specify a
default (instead of raising AttributeError).
- Implement round() slightly different, so that for negative ndigits
no additional errors happen in the last step.
- The open() function now adds the filename to the exception when it
fails.
Built-in exceptions
-------------------
- New standard exceptions EnvironmentError and PosixError.
EnvironmentError is the base class for IOError and PosixError;
PosixError is the same as os.error. All this so that either exception
class can be instantiated with a third argument indicating a filename.
The built-in function open() and most os/posix functions that take a
filename argument now use this.
Built-in types
--------------
- List objects now have an experimental pop() method; l.pop() returns
and removes the last item; l.pop(i) returns and removes the item at
i. Also, the sort() method is faster again. Sorting is now also
safer: it is impossible for the sorting function to modify the list
while the sort is going on (which could cause core dumps).
- Changes to comparisons: numbers are now smaller than any other type.
This is done to prevent the circularity where [] < 0L < 1 < [] is
true. As a side effect, cmp(None, 0) is now positive instead of
negative. This *shouldn't* affect any working code, but I've found
that the change caused several "sleeping" bugs to become active, so
beware!
- Instance methods may now have other callable objects than just
Python functions as their im_func. Use new.instancemethod() or write
your own C code to create them; new.instancemethod() may be called
with None for the instance to create an unbound method.
- Assignment to __name__, __dict__ or __bases__ of a class object is
now allowed (with stringent type checks); also allow assignment to
__getattr__ etc. The cached values for __getattr__ etc. are
recomputed after such assignments (but not for derived classes :-( ).
- Allow assignment to some attributes of function objects: func_code,
func_defaults and func_doc / __doc__. (With type checks except for
__doc__ / func_doc .)
Python services
---------------
- New tests (in Lib/test): reperf.py (regular expression benchmark),
sortperf.py (list sorting benchmark), test_MimeWriter.py (test case
for the MimeWriter module).
- Generalized test/regrtest.py so that it is useful for testing other
packages.
- The ihooks.py module now understands package imports.
- In code.py, add a class that subsumes Fredrik Lundh's
PythonInterpreter class. The interact() function now uses this.
- In rlcompleter.py, in completer(), return None instead of raising an
IndexError when there are no more completions left.
- Fixed the marshal module to test for certain common kinds of invalid
input. (It's still not foolproof!)
- In the operator module, add an alias (now the preferred name)
"contains" for "sequenceincludes".
String Services
---------------
- In the string and strop modules, in the replace() function, treat an
empty pattern as an error (since it's not clear what was meant!).
- Some speedups to re.py, especially the string substitution and split
functions. Also added new function/method findall(), to find all
occurrences of a given substring.
- In cStringIO, add better argument type checking and support the
readonly 'closed' attribute (like regular files).
- In the struct module, unsigned 1-2 byte sized formats no longer
result in long integer values.
Miscellaneous services
----------------------
- In whrandom.py, added new method and function randrange(), same as
choice(range(start, stop, step)) but faster. This addresses the
problem that randint() was accidentally defined as taking an inclusive
range. Also, randint(a, b) is now redefined as randrange(a, b+1),
adding extra range and type checking to its arguments!
- Add some semi-thread-safety to random.gauss() (it used to be able to
crash when invoked from separate threads; now the worst it can do is
give a duplicate result occasionally).
- Some restructuring and generalization done to cmd.py.
- Major upgrade to ConfigParser.py; converted to using 're', added new
exceptions, support underscore in section header and option name. No
longer add 'name' option to every section; instead, add '__name__'.
- In getpass.py, don't use raw_input() to ask for the password -- we
don't want it to show up in the readline history! Also don't catch
interrupts (the try-finally already does all necessary cleanup).
Generic OS Services
-------------------
- New functions in os.py: makedirs(), removedirs(), renames(). New
variable: linesep (the line separator as found in binary files,
i.e. '\n' on Unix, '\r\n' on DOS/Windows, '\r' on Mac. Do *not* use
this with files opened in (default) text mode; the line separator used
will always be '\n'!
- Changes to the 'os.path' submodule of os.py: added getsize(),
getmtime(), getatime() -- these fetch the most popular items from the
stat return tuple.
- In the time module, add strptime(), if it exists. (This parses a
time according to a format -- the inverse of strftime().) Also,
remove the call to mktime() from strftime() -- it messed up the
formatting of some non-local times.
- In the socket module, added a new function gethostbyname_ex().
Also, don't use #ifdef to test for some symbols that are enums on some
platforms (and should exist everywhere).
Optional OS Services
--------------------
- Some fixes to gzip.py. In particular, the readlines() method now
returns the lines *with* trailing newline characters, like readlines()
of regular file objects. Also, it didn't work together with cPickle;
fixed that.
- In whichdb.py, support byte-swapped dbhash (bsddb) files.
- In anydbm.py, look at the type of an existing database to determine
which module to use to open it. (The anydbm.error exception is now a
tuple.)
Unix Services
-------------
- In the termios module, in tcsetattr(), initialize the structure vy
calling tcgetattr().
- Added some of the "wait status inspection" macros as functions to
the posix module (and thus to the os module): WEXITSTATUS(),
WIFEXITED(), WIFSIGNALED(), WIFSTOPPED(), WSTOPSIG(), WTERMSIG().
- In the syslog module, make the default facility more intuitive
(matching the docs).
Debugger
--------
- In pdb.py, support for setting breaks on files/modules that haven't
been loaded yet.
Internet Protocols and Support
------------------------------
- Changes in urllib.py; sped up unquote() and quote(). Fixed an
obscure bug in quote_plus(). Added urlencode(dict) -- convenience
function for sending a POST request with urlopen(). Use the getpass
module to ask for a password. Rewrote the (test) main program so that
when used as a script, it can retrieve one or more URLs to stdout.
Use -t to run the self-test. Made the proxy code work again.
- In cgi.py, treat "HEAD" the same as "GET", so that CGI scripts don't
fail when someone asks for their HEAD. Also, for POST, set the
default content-type to application/x-www-form-urlencoded. Also, in
FieldStorage.__init__(), when method='GET', always get the query
string from environ['QUERY_STRING'] or sys.argv[1] -- ignore an
explicitly passed in fp.
- The smtplib.py module now supports ESMTP and has improved standard
compliance, for picky servers.
- Improved imaplib.py.
- Fixed UDP support in SocketServer.py (it never worked).
- Fixed a small bug in CGIHTTPServer.py.
Internet Data handling
----------------------
- In rfc822.py, add a new class AddressList. Also support a new
overridable method, isheader(). Also add a get() method similar to
dictionaries (and make getheader() an alias for it). Also, be smarter
about seekable (test whether fp.tell() works) and test for presence of
unread() method before trying seeks.
- In sgmllib.py, restore the call to report_unbalanced() that was lost
long ago. Also some other improvements: handle <? processing
instructions >, allow . and - in entity names, and allow \r\n as line
separator.
- Some restructuring and generalization done to multifile.py; support
a 'seekable' flag.
Restricted Execution
--------------------
- Improvements to rexec.py: package support; support a (minimal)
sys.exc_info(). Also made the (test) main program a bit fancier (you
can now use it to run arbitrary Python scripts in restricted mode).
Tkinter
-------
- On Unix, Tkinter can now safely be used from a multi-threaded
application. (Formerly, no threads would make progress while
Tkinter's mainloop() was active, because it didn't release the Python
interpreter lock.) Unfortunately, on Windows, threads other than the
main thread should not call update() or update_idletasks() because
this will deadlock the application.
- An interactive interpreter that uses readline and Tkinter no longer
uses up all available CPU time.
- Even if readline is not used, Tk windows created in an interactive
interpreter now get continuously updated. (This even works in Windows
as long as you don't hit a key.)
- New demos in Demo/tkinter/guido/: brownian.py, redemo.py, switch.py.
- No longer register Tcl_finalize() as a low-level exit handler. It
may call back into Python, and that's a bad idea.
- Allow binding of Tcl commands (given as a string).
- Some minor speedups; replace explicitly coded getint() with int() in
most places.
- In FileDialog.py, remember the directory of the selected file, if
given.
- Change the names of all methods in the Wm class: they are now
wm_title(), etc. The old names (title() etc.) are still defined as
aliases.
- Add a new method of interpreter objects, interpaddr(). This returns
the address of the Tcl interpreter object, as an integer. Not very
useful for the Python programmer, but this can be called by another C
extension that needs to make calls into the Tcl/Tk C API and needs to
get the address of the Tcl interpreter object. A simple cast of the
return value to (Tcl_Interp *) will do the trick.
Windows General
---------------
- Don't insist on proper case for module source files if the filename
is all uppercase (e.g. FOO.PY now matches foo; but FOO.py still
doesn't). This should address problems with this feature on
oldfashioned filesystems (Novell servers?).
Windows Library
---------------
- os.environ is now all uppercase, but accesses are case insensitive,
and the putenv() calls made as a side effect of changing os.environ
are case preserving.
- Removed samefile(), sameopenfile(), samestat() from os.path (aka
ntpath.py) -- these cannot be made to work reliably (at least I
wouldn't know how).
- Fixed os.pipe() so that it returns file descriptors acceptable to
os.read() and os.write() (like it does on Unix), rather than Windows
file handles.
- Added a table of WSA error codes to socket.py.
- In the select module, put the (huge) file descriptor arrays on the
heap.
- The getpass module now raises KeyboardInterrupt when it sees ^C.
- In mailbox.py, fix tell/seek when using files opened in text mode.
- In rfc822.py, fix tell/seek when using files opened in text mode.
- In the msvcrt extension module, release the interpreter lock for
calls that may block: _locking(), _getch(), _getche(). Also fix a
bogus error return when open_osfhandle() doesn't have the right
argument list.
Windows Installer
-----------------
- The registry key used is now "1.5" instead of "1.5.x" -- so future
versions of 1.5 and Mark Hammond's win32all installer don't need to be
resynchronized.
Windows Tools
-------------
- Several improvements to freeze specifically for Windows.
Windows Build Procedure
-----------------------
- The VC++ project files and the WISE installer have been moved to the
PCbuild subdirectory, so they are distributed in the same subdirectory
where they must be used. This avoids confusion.
- New project files for Windows 3.1 port by Jim Ahlstrom.
- Got rid of the obsolete subdirectory PC/setup_nt/.
- The projects now use distinct filenames for the .exe, .dll, .lib and
.pyd files built in debug mode (by appending "_d" to the base name,
before the extension). This makes it easier to switch between the two
and get the right versions. There's a pragma in config.h that directs
the linker to include the appropriate .lib file (so python15.lib no
longer needs to be explicit in your project).
- The installer now installs more files (e.g. config.h). The idea is
that you shouldn't need the source distribution if you want build your
own extensions in C or C++.
Tools and Demos
---------------
- New script nm2def.py by Marc-Andre Lemburg, to construct
PC/python_nt.def automatically (some hand editing still required).
- New tool ndiff.py: Tim Peters' text diffing tool.
- Various and sundry improvements to the freeze script.
- The script texi2html.py (which was part of the Doc tree but is no
longer used there) has been moved to the Tools/scripts subdirectory.
- Some generalizations in the webchecker code. There's now a
primnitive gui for websucker.py: wsgui.py. (In Tools/webchecker/.)
- The ftpmirror.py script now handles symbolic links properly, and
also files with multiple spaces in their names.
- The 1.5.1 tabnanny.py suffers an assert error if fed a script whose
last line is both indented and lacks a newline. This is now fixed.
Python/C API
------------
- Added missing prototypes for PyEval_CallFunction() and
PyEval_CallMethod().
- New macro PyList_SET_ITEM().
- New macros to access object members for PyFunction, PyCFunction
objects.
- New APIs PyImport_AppendInittab() an PyImport_ExtendInittab() to
dynamically add one or many entries to the table of built-in modules.
- New macro Py_InitModule3(name, methods, doc) which calls
Py_InitModule4() with appropriate arguments. (The -4 variant requires
you to pass an obscure version number constant which is always the same.)
- New APIs PySys_WriteStdout() and PySys_WriteStderr() to write to
sys.stdout or sys.stderr using a printf-like interface. (Used in
_tkinter.c, for example.)
- New APIs for conversion between Python longs and C 'long long' if
your compiler supports it.
- PySequence_In() is now called PySequence_Contains().
(PySequence_In() is still supported for b/w compatibility; it is
declared obsolete because its argument order is confusing.)
- PyDict_GetItem() and PyDict_GetItemString() are changed so that they
*never* raise an exception -- (even if the hash() fails, simply clear
the error). This was necessary because there is lots of code out
there that already assumes this.
- Changes to PySequence_Tuple() and PySequence_List() to use the
length of a sequence only as a hint -- if an IndexError happens
earlier, take that. (Formerly, this was considered an error.)
- Reformatted abstract.c to give it a more familiar "look" and fixed
many error checking bugs.
- Add NULL pointer checks to all calls of a C function through a type
object and extensions (e.g. nb_add).
- The code that initializes sys.path now calls Py_GetPythonHome()
instead of getenv("PYTHONHOME"). This, together with the new API
Py_SetPythonHome(), makes it easier for embedding applications to
change the notion of Python's "home" directory (where the libraries
etc. are sought).
- Fixed a very old bug in the parsing of "O?" format specifiers.
======================================================================
========================================
==> Release 1.5.1 (October 31, 1998) <==
========================================
From 1.5 to 1.5.1
=================
General
-------
- The documentation is now unbundled. It has also been extensively
modified (mostly to implement a new and more uniform formatting
style). We figure that most people will prefer to download one of the
preformatted documentation sets (HTML, PostScript or PDF) and that
only a minority have a need for the LaTeX or FrameMaker sources. Of
course, the unbundled documentation sources still released -- just not
in the same archive file, and perhaps not on the same date.
- All bugs noted on the errors page (and many unnoted) are fixed. All
new bugs take their places.
- No longer a core dump when attempting to print (or repr(), or str())
a list or dictionary that contains an instance of itself; instead, the
recursive entry is printed as [...] or {...}. See Py_ReprEnter() and
Py_ReprLeave() below. Comparisons of such objects still go beserk,
since this requires a different kind of fix; fortunately, this is a
less common scenario in practice.
Syntax change
-------------
- The raise statement can now be used without arguments, to re-raise
a previously set exception. This should be used after catching an
exception with an except clause only, either in the except clause or
later in the same function.
Import and module handling
--------------------------
- The implementation of import has changed to use a mutex (when
threading is supported). This means that when two threads
simultaneously import the same module, the import statements are
serialized. Recursive imports are not affected.
- Rewrote the finalization code almost completely, to be much more
careful with the order in which modules are destroyed. Destructors
will now generally be able to reference built-in names such as None
without trouble.
- Case-insensitive platforms such as Mac and Windows require the case
of a module's filename to match the case of the module name as
specified in the import statement (see below).
- The code for figuring out the default path now distinguishes between
files, modules, executable files, and directories. When expecting a
module, we also look for the .pyc or .pyo file.
Parser/tokenizer changes
------------------------
- The tokenizer can now warn you when your source code mixes tabs and
spaces for indentation in a manner that depends on how much a tab is
worth in spaces. Use "python -t" or "python -v" to enable this
option. Use "python -tt" to turn the warnings into errors. (See also
tabnanny.py and tabpolice.py below.)
- Return unsigned characters from tok_nextc(), so '\377' isn't
mistaken for an EOF character.
- Fixed two pernicious bugs in the tokenizer that only affected AIX.
One was actually a general bug that was triggered by AIX's smaller I/O
buffer size. The other was a bug in the AIX optimizer's loop
unrolling code; swapping two statements made the problem go away.
Tools, demos and miscellaneous files
------------------------------------
- There's a new version of Misc/python-mode.el (the Emacs mode for
Python) which is much smarter about guessing the indentation style
used in a particular file. Lots of other cool features too!
- There are two new tools in Tools/scripts: tabnanny.py and
tabpolice.py, implementing two different ways of checking whether a
file uses indentation in a way that is sensitive to the interpretation
of a tab. The preferred module is tabnanny.py (by Tim Peters).
- Some new demo programs:
Demo/tkinter/guido/paint.py -- Dave Mitchell
Demo/sockets/unixserver.py -- Piet van Oostrum
- Much better freeze support. The freeze script can now freeze
hierarchical module names (with a corresponding change to import.c),
and has a few extra options (e.g. to suppress freezing specific
modules). It also does much more on Windows NT.
- Version 1.0 of the faq wizard is included (only very small changes
since version 0.9.0).
- New feature for the ftpmirror script: when removing local files
(i.e., only when -r is used), do a recursive delete.
Configuring and building Python
-------------------------------
- Get rid of the check for -linet -- recent Sequent Dynix systems don't
need this any more and apparently it screws up their configuration.
- Some changes because gcc on SGI doesn't support '-all'.
- Changed the build rules to use $(LIBRARY) instead of
-L.. -lpython$(VERSION)
since the latter trips up the SunOS 4.1.x linker (sigh).
- Fix the bug where the '# dgux is broken' comment in the Makefile
tripped over Make on some platforms.
- Changes for AIX: install the python.exp file; properly use
$(srcdir); the makexp_aix script now removes C++ entries of the form
Class::method.
- Deleted some Makefile targets only used by the (long obsolete)
gMakefile hacks.
Extension modules
-----------------
- Performance and threading improvements to the socket and bsddb
modules, by Christopher Lindblad of Infoseek.
- Added operator.__not__ and operator.not_.
- In the thread module, when a thread exits due to an unhandled
exception, don't store the exception information in sys.last_*; it
prevents proper calling of destructors of local variables.
- Fixed a number of small bugs in the cPickle module.
- Changed find() and rfind() in the strop module so that
find("x","",2) returns -1, matching the implementation in string.py.
- In the time module, be more careful with the result of ctime(), and
test for HAVE_MKTIME before usinmg mktime().
- Doc strings contributed by Mitch Chapman to the termios, pwd, gdbm
modules.
- Added the LOG_SYSLOG constant to the syslog module, if defined.
Standard library modules
------------------------
- All standard library modules have been converted to an indentation
style using either only tabs or only spaces -- never a mixture -- if
they weren't already consistent according to tabnanny. This means
that the new -t option (see above) won't complain about standard
library modules.
- New standard library modules:
threading -- GvR and the thread-sig
Java style thread objects -- USE THIS!!!
getpass -- Piers Lauder
simple utilities to prompt for a password and to
retrieve the current username
imaplib -- Piers Lauder
interface for the IMAP4 protocol
poplib -- David Ascher, Piers Lauder
interface for the POP3 protocol
smtplib -- Dragon De Monsyne
interface for the SMTP protocol
- Some obsolete modules moved to a separate directory (Lib/lib-old)
which is *not* in the default module search path:
Para
addpack
codehack
fmt
lockfile
newdir
ni
rand
tb
- New version of the PCRE code (Perl Compatible Regular Expressions --
the re module and the supporting pcre extension) by Andrew Kuchling.
Incompatible new feature in re.sub(): the handling of escapes in the
replacement string has changed.
- Interface change in the copy module: a __deepcopy__ method is now
called with the memo dictionary as an argument.
- Feature change in the tokenize module: differentiate between NEWLINE
token (an official newline) and NL token (a newline that the grammar
ignores).
- Several bugfixes to the urllib module. It is now truly thread-safe,
and several bugs and a portability problem have been fixed. New
features, all due to Sjoerd Mullender: When creating a temporary file,
it gives it an appropriate suffix. Support the "data:" URL scheme.
The open() method uses the tempcache.
- New version of the xmllib module (this time with a test suite!) by
Sjoerd Mullender.
- Added debugging code to the telnetlib module, to be able to trace
the actual traffic.
- In the rfc822 module, added support for deleting a header (still no
support for adding headers, though). Also fixed a bug where an
illegal address would cause a crash in getrouteaddr(), fixed a
sign reversal in mktime_tz(), and use the local timezone by default
(the latter two due to Bill van Melle).
- The normpath() function in the dospath and ntpath modules no longer
does case normalization -- for that, use the separate function
normcase() (which always existed); normcase() has been sped up and
fixed (it was the cause of a crash in Mark Hammond's installer in
certain locales).
- New command supported by the ftplib module: rmd(); also fixed some
minor bugs.
- The profile module now uses a different timer function by default --
time.clock() is generally better than os.times(). This makes it work
better on Windows NT, too.
- The tempfile module now recovers when os.getcwd() raises an
exception.
- Fixed some bugs in the random module; gauss() was subtly wrong, and
vonmisesvariate() should return a full circle. Courtesy Mike Miller,
Lambert Meertens (gauss()), and Magnus Kessler (vonmisesvariate()).
- Better default seed in the whrandom module, courtesy Andrew Kuchling.
- Fix slow close() in shelve module.
- The Unix mailbox class in the mailbox module is now more robust when
a line begins with the string "From " but is definitely not the start
of a new message. The pattern used can be changed by overriding a
method or class variable.
- Added a rmtree() function to the copy module.
- Fixed several typos in the pickle module. Also fixed problems when
unpickling in restricted execution environments.
- Added docstrings and fixed a typo in the py_compile and compileall
modules. At Mark Hammond's repeated request, py_compile now append a
newline to the source if it needs one. Both modules support an extra
parameter to specify the purported source filename (to be used in
error messages).
- Some performance tweaks by Jeremy Hylton to the gzip module.
- Fixed a bug in the merge order of dictionaries in the ConfigParser
module. Courtesy Barry Warsaw.
- In the multifile module, support the optional second parameter to
seek() when possible.
- Several fixes to the gopherlib module by Lars Marius Garshol. Also,
urlparse now correctly handles Gopher URLs with query strings.
- Fixed a tiny bug in format_exception() in the traceback module.
Also rewrite tb_lineno() to be compatible with JPython (and not
disturb the current exception!); by Jim Hugunin.
- The httplib module is more robust when servers send a short response
-- courtesy Tim O'Malley.
Tkinter and friends
-------------------
- Various typos and bugs fixed.
- New module Tkdnd implements a drag-and-drop protocol (within one
application only).
- The event_*() widget methods have been restructured slightly -- they
no longer use the default root.
- The interfaces for the bind*() and unbind() widget methods have been
redesigned; the bind*() methods now return the name of the Tcl command
created for the callback, and this can be passed as a optional
argument to unbind() in order to delete the command (normally, such
commands are automatically unbound when the widget is destroyed, but
for some applications this isn't enough).
- Variable objects now have trace methods to interface to Tcl's
variable tracing facilities.
- Image objects now have an optional keyword argument, 'master', to
specify a widget (tree) to which they belong. The image_names() and
image_types() calls are now also widget methods.
- There's a new global call, Tkinter.NoDefaultRoot(), which disables
all use of the default root by the Tkinter library. This is useful to
debug applications that are in the process of being converted from
relying on the default root to explicit specification of the root
widget.
- The 'exit' command is deleted from the Tcl interpreter, since it
provided a loophole by which one could (accidentally) exit the Python
interpreter without invoking any cleanup code.
- Tcl_Finalize() is now registered as a Python low-level exit handle,
so Tcl will be finalized when Python exits.
The Python/C API
----------------
- New function PyThreadState_GetDict() returns a per-thread dictionary
intended for storing thread-local global variables.
- New functions Py_ReprEnter() and Py_ReprLeave() use the per-thread
dictionary to allow recursive container types to detect recursion in
their repr(), str() and print implementations.
- New function PyObject_Not(x) calculates (not x) according to Python's
standard rules (basically, it negates the outcome PyObject_IsTrue(x).
- New function _PyModule_Clear(), which clears a module's dictionary
carefully without removing the __builtins__ entry. This is implied
when a module object is deallocated (this used to clear the dictionary
completely).
- New function PyImport_ExecCodeModuleEx(), which extends
PyImport_ExecCodeModule() by adding an extra parameter to pass it the
true file.
- New functions Py_GetPythonHome() and Py_SetPythonHome(), intended to
allow embedded applications to force a different value for PYTHONHOME.
- New global flag Py_FrozenFlag is set when this is a "frozen" Python
binary; it suppresses warnings about not being able to find the
standard library directories.
- New global flag Py_TabcheckFlag is incremented by the -t option and
causes the tokenizer to issue warnings or errors about inconsistent
mixing of tabs and spaces for indentation.
Miscellaneous minor changes and bug fixes
-----------------------------------------
- Improved the error message when an attribute of an attribute-less
object is requested -- include the name of the attribute and the type
of the object in the message.
- Sped up int(), long(), float() a bit.
- Fixed a bug in list.sort() that would occasionally dump core.
- Fixed a bug in PyNumber_Power() that caused numeric arrays to fail
when taken tothe real power.
- Fixed a number of bugs in the file reading code, at least one of
which could cause a core dump on NT, and one of which would
occasionally cause file.read() to return less than the full contents
of the file.
- Performance hack by Vladimir Marangozov for stack frame creation.
- Make sure setvbuf() isn't used unless HAVE_SETVBUF is defined.
Windows 95/NT
-------------
- The .lib files are now part of the distribution; they are collected
in the subdirectory "libs" of the installation directory.
- The extension modules (.pyd files) are now collected in a separate
subdirectory of the installation directory named "DLLs".
- The case of a module's filename must now match the case of the
module name as specified in the import statement. This is an
experimental feature -- if it turns out to break in too many
situations, it will be removed (or disabled by default) in the future.
It can be disabled on a per-case basis by setting the environment
variable PYTHONCASEOK (to any value).
======================================================================
=====================================
==> Release 1.5 (January 3, 1998) <==
=====================================
From 1.5b2 to 1.5
=================
- Newly documentated module: BaseHTTPServer.py, thanks to Greg Stein.
- Added doc strings to string.py, stropmodule.c, structmodule.c,
thanks to Charles Waldman.
- Many nits fixed in the manuals, thanks to Fred Drake and many others
(especially Rob Hooft and Andrew Kuchling). The HTML version now uses
HTML markup instead of inline GIF images for tables; only two images
are left (for obsure bits of math). The index of the HTML version has
also been much improved. Finally, it is once again possible to
generate an Emacs info file from the library manual (but I don't
commit to supporting this in future versions).
- New module: telnetlib.py (a simple telnet client library).
- New tool: Tools/versioncheck/, by Jack Jansen.
- Ported zlibmodule.c and bsddbmodule.c to NT; The project file for MS
DevStudio 5.0 now includes new subprojects to build the zlib and bsddb
extension modules.
- Many small changes again to Tkinter.py -- mostly bugfixes and adding
missing routines. Thanks to Greg McFarlane for reporting a bunch of
problems and proofreading my fixes.
- The re module and its documentation are up to date with the latest
version released to the string-sig (Dec. 22).
- Stop test_grp.py from failing when the /etc/group file is empty
(yes, this happens!).
- Fix bug in integer conversion (mystrtoul.c) that caused
4294967296==0 to be true!
- The VC++ 4.2 project file should be complete again.
- In tempfile.py, use a better template on NT, and add a new optional
argument "suffix" with default "" to specify a specific extension for
the temporary filename (needed sometimes on NT but perhaps also handy
elsewhere).
- Fixed some bugs in the FAQ wizard, and converted it to use re
instead of regex.
- Fixed a mysteriously undetected error in dlmodule.c (it was using a
totally bogus routine name to raise an exception).
- Fixed bug in import.c which wasn't using the new "dos-8x3" name yet.
- Hopefully harmless changes to the build process to support shared
libraries on DG/UX. This adds a target to create
libpython$(VERSION).so; however this target is *only* for DG/UX.
- Fixed a bug in the new format string error checking in getargs.c.
- A simple fix for infinite recursion when printing __builtins__:
reset '_' to None before printing and set it to the printed variable
*after* printing (and only when printing is successful).
- Fixed lib-tk/SimpleDialog.py to keep the dialog visible even if the
parent window is not (Skip Montanaro).
- Fixed the two most annoying problems with ftp URLs in
urllib.urlopen(); an empty file now correctly raises an error, and it
is no longer required to explicitly close the returned "file" object
before opening another ftp URL to the same host and directory.
======================================================================
From 1.5b1 to 1.5b2
===================
- Fixed a bug in cPickle.c that caused it to crash right away because
the version string had a different format.
- Changes in pickle.py and cPickle.c: when unpickling an instance of a
class that doesn't define the __getinitargs__() method, the __init__()
constructor is no longer called. This makes a much larger group of
classes picklable by default, but may occasionally change semantics.
To force calling __init__() on unpickling, define a __getinitargs__()
method. Other changes too, in particular cPickle now handles classes
defined in packages correctly. The same change applies to copying
instances with copy.py. The cPickle.c changes and some pickle.py
changes are courtesy Jim Fulton.
- Locale support in he "re" (Perl regular expressions) module. Use
the flag re.L (or re.LOCALE) to enable locale-specific matching
rules for \w and \b. The in-line syntax for this flag is (?L).
- The built-in function isinstance(x, y) now also succeeds when y is
a type object and type(x) is y.
- repr() and str() of class and instance objects now reflect the
package/module in which the class is defined.
- Module "ni" has been removed. (If you really need it, it's been
renamed to "ni1". Let me know if this causes any problems for you.
Package authors are encouraged to write __init__.py files that
support both ni and 1.5 package support, so the same version can be
used with Python 1.4 as well as 1.5.)
- The thread module is now automatically included when threads are
configured. (You must remove it from your existing Setup file,
since it is now in its own Setup.thread file.)
- New command line option "-x" to skip the first line of the script;
handy to make executable scripts on non-Unix platforms.
- In importdl.c, add the RTLD_GLOBAL to the dlopen() flags. I
haven't checked how this affects things, but it should make symbols
in one shared library available to the next one.
- The Windows installer now installs in the "Program Files" folder on
the proper volume by default.
- The Windows configuration adds a new main program, "pythonw", and
registers a new extension, ".pyw" that invokes this. This is a
pstandard Python interpreter that does not pop up a console window;
handy for pure Tkinter applications. All output to the original
stdout and stderr is lost; reading from the original stdin yields
EOF. Also, both python.exe and pythonw.exe now have a pretty icon
(a green snake in a box, courtesy Mark Hammond).
- Lots of improvements to emacs-mode.el again. See Barry's web page:
http://www.python.org/ftp/emacs/pmdetails.html.
- Lots of improvements and additions to the library reference manual;
many by Fred Drake.
- Doc strings for the following modules: rfc822.py, posixpath.py,
ntpath.py, httplib.py. Thanks to Mitch Chapman and Charles Waldman.
- Some more regression testing.
- An optional 4th (maxsplit) argument to strop.replace().
- Fixed handling of maxsplit in string.splitfields().
- Tweaked os.environ so it can be pickled and copied.
- The portability problems caused by indented preprocessor commands
and C++ style comments should be gone now.
- In random.py, added Pareto and Weibull distributions.
- The crypt module is now disabled in Modules/Setup.in by default; it
is rarely needed and causes errors on some systems where users often
don't know how to deal with those.
- Some improvements to the _tkinter build line suggested by Case Roole.
- A full suite of platform specific files for NetBSD 1.x, submitted by
Anders Andersen.
- New Solaris specific header STROPTS.py.
- Moved a confusing occurrence of *shared* from the comments in
Modules/Setup.in (people would enable this one instead of the real
one, and get disappointing results).
- Changed the default mode for directories to be group-writable when
the installation process creates them.
- Check for pthread support in "-l_r" for FreeBSD/NetBSD, and support
shared libraries for both.
- Support FreeBSD and NetBSD in posixfile.py.
- Support for the "event" command, new in Tk 4.2. By Case Roole.
- Add Tix_SafeInit() support to tkappinit.c.
- Various bugs fixed in "re.py" and "pcre.c".
- Fixed a bug (broken use of the syntax table) in the old "regexpr.c".
- In frozenmain.c, stdin is made unbuffered too when PYTHONUNBUFFERED
is set.
- Provide default blocksize for retrbinary in ftplib.py (Skip
Montanaro).
- In NT, pick the username up from different places in user.py (Jeff
Bauer).
- Patch to urlparse.urljoin() for ".." and "..#1", Marc Lemburg.
- Many small improvements to Jeff Rush' OS/2 support.
- ospath.py is gone; it's been obsolete for so many years now...
- The reference manual is now set up to prepare better HTML (still
using webmaker, alas).
- Add special handling to /Tools/freeze for Python modules that are
imported implicitly by the Python runtime: 'site' and 'exceptions'.
- Tools/faqwiz 0.8.3 -- add an option to suppress URL processing
inside <PRE>, by "Scott".
- Added ConfigParser.py, a generic parser for sectioned configuration
files.
- In _localemodule.c, LC_MESSAGES is not always defined; put it
between #ifdefs.
- Typo in resource.c: RUSAGE_CHILDERN -> RUSAGE_CHILDREN.
- Demo/scripts/newslist.py: Fix the way the version number is gotten
out of the RCS revision.
- PyArg_Parse[Tuple] now explicitly check for bad characters at the
end of the format string.
- Revamped PC/example_nt to support VC++ 5.x.
- <listobject>.sort() now uses a modified quicksort by Raymund Galvin,
after studying the GNU libg++ quicksort. This should be much faster
if there are lots of duplicates, and otherwise at least as good.
- Added "uue" as an alias for "uuencode" to mimetools.py. (Hm, the
uudecode bug where it complaints about trailing garbage is still there
:-( ).
- pickle.py requires integers in text mode to be in decimal notation
(it used to accept octal and hex, even though it would only generate
decimal numbers).
- In string.atof(), don't fail when the "re" module is unavailable.
Plug the ensueing security leak by supplying an empty __builtins__
directory to eval().
- A bunch of small fixes and improvements to Tkinter.py.
- Fixed a buffer overrun in PC/getpathp.c.
======================================================================
From 1.5a4 to 1.5b1
===================
- The Windows NT/95 installer now includes full HTML of all manuals.
It also has a checkbox that lets you decide whether to install the
interpreter and library. The WISE installer script for the installer
is included in the source tree as PC/python15.wse, and so are the
icons used for Python files. The config.c file for the Windows build
is now complete with the pcre module.
- sys.ps1 and sys.ps2 can now arbitrary objects; their str() is
evaluated for the prompt.
- The reference manual is brought up to date (more or less -- it still
needs work, e.g. in the area of package import).
- The icons used by latex2html are now included in the Doc
subdirectory (mostly so that tarring up the HTML files can be fully
automated). A simple index.html is also added to Doc (it only works
after you have successfully run latex2html).
- For all you would-be proselytizers out there: a new version of
Misc/BLURB describes Python more concisely, and Misc/comparisons
compares Python to several other languages. Misc/BLURB.WINDOWS
contains a blurb specifically aimed at Windows programmers (by Mark
Hammond).
- A new version of the Python mode for Emacs is included as
Misc/python-mode.el. There are too many new features to list here.
See http://www.python.org/ftp/emacs/pmdetails.html for more info.
- New module fileinput makes iterating over the lines of a list of
files easier. (This still needs some more thinking to make it more
extensible.)
- There's full OS/2 support, courtesy Jeff Rush. To build the OS/2
version, see PC/readme.txt and PC/os2vacpp. This is for IBM's Visual
Age C++ compiler. I expect that Jeff will also provide a binary
release for this platform.
- On Linux, the configure script now uses '-Xlinker -export-dynamic'
instead of '-rdynamic' to link the main program so that it exports its
symbols to shared libraries it loads dynamically. I hope this doesn't
break on older Linux versions; it is needed for mklinux and appears to
work on Linux 2.0.30.
- Some Tkinter resstructuring: the geometry methods that apply to a
master are now properly usable on toplevel master widgets. There's a
new (internal) widget class, BaseWidget. New, longer "official" names
for the geometry manager methods have been added,
e.g. "grid_columnconfigure()" instead of "columnconfigure()". The old
shorter names still work, and where there's ambiguity, pack wins over
place wins over grid. Also, the bind_class method now returns its
value.
- New, RFC-822 conformant parsing of email addresses and address lists
in the rfc822 module, courtesy Ben Escoto.
- New, revamped tkappinit.c with support for popular packages (PIL,
TIX, BLT, TOGL). For the last three, you need to execute the Tcl
command "load {} Tix" (or Blt, or Togl) to gain access to them.
The Modules/Setup line for the _tkinter module has been rewritten
using the cool line-breaking feature of most Bourne shells.
- New socket method connect_ex() returns the error code from connect()
instead of raising an exception on errors; this makes the logic
required for asynchronous connects simpler and more efficient.
- New "locale" module with (still experimental) interface to the
standard C library locale interface, courtesy Martin von Loewis. This
does not repeat my mistake in 1.5a4 of always calling
setlocale(LC_ALL, ""). In fact, we've pretty much decided that
Python's standard numerical formatting operations should always use
the conventions for the C locale; the locale module contains utility
functions to format numbers according to the user specified locale.
(All this is accomplished by an explicit call to setlocale(LC_NUMERIC,
"C") after locale-changing calls.) See the library manual. (Alas, the
promised changes to the "re" module for locale support have not been
materialized yet. If you care, volunteer!)
- Memory leak plugged in Py_BuildValue when building a dictionary.
- Shared modules can now live inside packages (hierarchical module
namespaces). No changes to the shared module itself are needed.
- Improved policy for __builtins__: this is a module in __main__ and a
dictionary everywhere else.
- Python no longer catches SIGHUP and SIGTERM by default. This was
impossible to get right in the light of thread contexts. If you want
your program to clean up when a signal happens, use the signal module
to set up your own signal handler.
- New Python/C API PyNumber_CoerceEx() does not return an exception
when no coercion is possible. This is used to fix a problem where
comparing incompatible numbers for equality would raise an exception
rather than return false as in Python 1.4 -- it once again will return
false.
- The errno module is changed again -- the table of error messages
(errorstr) is removed. Instead, you can use os.strerror(). This
removes redundance and a potential locale dependency.
- New module xmllib, to parse XML files. By Sjoerd Mullender.
- New C API PyOS_AfterFork() is called after fork() in posixmodule.c.
It resets the signal module's notion of what the current process ID
and thread are, so that signal handlers will work after (and across)
calls to os.fork().
- Fixed most occurrences of fatal errors due to missing thread state.
- For vgrind (a flexible source pretty printer) fans, there's a simple
Python definition in Misc/vgrindefs, courtesy Neale Pickett.
- Fixed memory leak in exec statement.
- The test.pystone module has a new function, pystones(loops=LOOPS),
which returns a (benchtime, stones) tuple. The main() function now
calls this and prints the report.
- Package directories now *require* the presence of an __init__.py (or
__init__.pyc) file before they are considered as packages. This is
done to prevent accidental subdirectories with common names from
overriding modules with the same name.
- Fixed some strange exceptions in __del__ methods in library modules
(e.g. urllib). This happens because the builtin names are already
deleted by the time __del__ is called. The solution (a hack, but it
works) is to set some instance variables to 0 instead of None.
- The table of built-in module initializers is replaced by a pointer
variable. This makes it possible to switch to a different table at
run time, e.g. when a collection of modules is loaded from a shared
library. (No example code of how to do this is given, but it is
possible.) The table is still there of course, its name prefixed with
an underscore and used to initialize the pointer.
- The warning about a thread still having a frame now only happens in
verbose mode.
- Change the signal finialization so that it also resets the signal
handlers. After this has been called, our signal handlers are no
longer active!
- New version of tokenize.py (by Ka-Ping Yee) recognizes raw string
literals. There's now also a test fort this module.
- The copy module now also uses __dict__.update(state) instead of
going through individual attribute assignments, for class instances
without a __setstate__ method.
- New module reconvert translates old-style (regex module) regular
expressions to new-style (re module, Perl-style) regular expressions.
- Most modules that used to use the regex module now use the re
module. The grep module has a new pgrep() function which uses
Perl-style regular expressions.
- The (very old, backwards compatibility) regexp.py module has been
deleted.
- Restricted execution (rexec): added the pcre module (support for the
re module) to the list of trusted extension modules.
- New version of Jim Fulton's CObject object type, adds
PyCObject_FromVoidPtrAndDesc() and PyCObject_GetDesc() APIs.
- Some patches to Lee Busby's fpectl mods that accidentally didn't
make it into 1.5a4.
- In the string module, add an optional 4th argument to count(),
matching find() etc.
- Patch for the nntplib module by Charles Waldman to add optional user
and password arguments to NNTP.__init__(), for nntp servers that need
them.
- The str() function for class objects now returns
"modulename.classname" instead of returning the same as repr().
- The parsing of \xXX escapes no longer relies on sscanf().
- The "sharedmodules" subdirectory of the installation is renamed to
"lib-dynload". (You may have to edit your Modules/Setup file to fix
this in an existing installation!)
- Fixed Don Beaudry's mess-up with the OPT test in the configure
script. Certain SGI platforms will still issue a warning for each
compile; there's not much I can do about this since the compiler's
exit status doesn't indicate that I was using an obsolete option.
- Fixed Barry's mess-up with {}.get(), and added test cases for it.
- Shared libraries didn't quite work under AIX because of the change
in status of the GNU readline interface. Fix due to by Vladimir
Marangozov.
======================================================================
From 1.5a3 to 1.5a4
===================
- faqwiz.py: version 0.8; Recognize https:// as URL; <html>...</html>
feature; better install instructions; removed faqmain.py (which was an
older version).
- nntplib.py: Fixed some bugs reported by Lars Wirzenius (to Debian)
about the treatment of lines starting with '.'. Added a minimal test
function.
- struct module: ignore most whitespace in format strings.
- urllib.py: close the socket and temp file in URLopener.retrieve() so
that multiple retrievals using the same connection work.
- All standard exceptions are now classes by default; use -X to make
them strings (for backward compatibility only).
- There's a new standard exception hierarchy, defined in the standard
library module exceptions.py (which you never need to import
explicitly). See
http://grail.cnri.reston.va.us/python/essays/stdexceptions.html for
more info.
- Three new C API functions:
- int PyErr_GivenExceptionMatches(obj1, obj2)
Returns 1 if obj1 and obj2 are the same object, or if obj1 is an
instance of type obj2, or of a class derived from obj2
- int PyErr_ExceptionMatches(obj)
Higher level wrapper around PyErr_GivenExceptionMatches() which uses
PyErr_Occurred() as obj1. This will be the more commonly called
function.
- void PyErr_NormalizeException(typeptr, valptr, tbptr)
Normalizes exceptions, and places the normalized values in the
arguments. If type is not a class, this does nothing. If type is a
class, then it makes sure that value is an instance of the class by:
1. if instance is of the type, or a class derived from type, it does
nothing.
2. otherwise it instantiates the class, using the value as an
argument. If value is None, it uses an empty arg tuple, and if
the value is a tuple, it uses just that.
- Another new C API function: PyErr_NewException() creates a new
exception class derived from Exception; when -X is given, it creates a
new string exception.
- core interpreter: remove the distinction between tuple and list
unpacking; allow an arbitrary sequence on the right hand side of any
unpack instruction. (UNPACK_LIST and UNPACK_TUPLE now do the same
thing, which should really be called UNPACK_SEQUENCE.)
- classes: Allow assignments to an instance's __dict__ or __class__,
so you can change ivars (including shared ivars -- shock horror) and
change classes dynamically. Also make the check on read-only
attributes of classes less draconic -- only the specials names
__dict__, __bases__, __name__ and __{get,set,del}attr__ can't be
assigned.
- Two new built-in functions: issubclass() and isinstance(). Both
take classes as their second arguments. The former takes a class as
the first argument and returns true iff first is second, or is a
subclass of second. The latter takes any object as the first argument
and returns true iff first is an instance of the second, or any
subclass of second.
- configure: Added configuration tests for presence of alarm(),
pause(), and getpwent().
- Doc/Makefile: changed latex2html targets.
- classes: Reverse the search order for the Don Beaudry hook so that
the first class with an applicable hook wins. Makes more sense.
- Changed the checks made in Py_Initialize() and Py_Finalize(). It is
now legal to call these more than once. The first call to
Py_Initialize() initializes, the first call to Py_Finalize()
finalizes. There's also a new API, Py_IsInitalized() which checks
whether we are already initialized (in case you want to leave things
as they were).
- Completely disable the declarations for malloc(), realloc() and
free(). Any 90's C compiler has these in header files, and the tests
to decide whether to suppress the declarations kept failing on some
platforms.
- *Before* (instead of after) signalmodule.o is added, remove both
intrcheck.o and sigcheck.o. This should get rid of warnings in ar or
ld on various systems.
- Added reop to PC/config.c
- configure: Decided to use -Aa -D_HPUX_SOURCE on HP-UX platforms.
Removed outdated HP-UX comments from README. Added Cray T3E comments.
- Various renames of statically defined functions that had name
conflicts on some systems, e.g. strndup (GNU libc), join (Cray),
roundup (sys/types.h).
- urllib.py: Interpret three slashes in file: URL as local file (for
Netscape on Windows/Mac).
- copy.py: Make sure the objects returned by __getinitargs__() are
kept alive (in the memo) to avoid a certain kind of nasty crash. (Not
easily reproducable because it requires a later call to
__getinitargs__() to return a tuple that happens to be allocated at
the same address.)
- Added definition of AR to toplevel Makefile. Renamed @buildno temp
file to buildno1.
- Moved Include/assert.h to Parser/assert.h, which seems to be the
only place where it's needed.
- Tweaked the dictionary lookup code again for some more speed
(Vladimir Marangozov).
- NT build: Changed the way python15.lib is included in the other
projects. Per Mark Hammond's suggestion, add it to the extra libs in
Settings instead of to the project's source files.
- regrtest.py: Change default verbosity so that there are only three
levels left: -q, default and -v. In default mode, the name of each
test is now printed. -v is the same as the old -vv. -q is more quiet
than the old default mode.
- Removed the old FAQ from the distribution. You now have to get it
from the web!
- Removed the PC/make_nt.in file from the distribution; it is no
longer needed.
- Changed the build sequence so that shared modules are built last.
This fixes things for AIX and doesn't hurt elsewhere.
- Improved test for GNU MP v1 in mpzmodule.c
- fileobject.c: ftell() on Linux discards all buffered data; changed
read() code to use lseek() instead to get the same effect
- configure.in, configure, importdl.c: NeXT sharedlib fixes
- tupleobject.c: PyTuple_SetItem asserts refcnt==1
- resource.c: Different strategy regarding whether to declare
getrusage() and getpagesize() -- #ifdef doesn't work, Linux has
conflicting decls in its headers. Choice: only declare the return
type, not the argument prototype, and not on Linux.
- importdl.c, configure*: set sharedlib extensions properly for NeXT
- configure*, Makefile.in, Modules/Makefile.pre.in: AIX shared libraries
fixed; moved addition of PURIFY to LINKCC to configure
- reopmodule.c, regexmodule.c, regexpr.c, zlibmodule.c: needed casts
added to shup up various compilers.
- _tkinter.c: removed buggy mac #ifndef
- Doc: various Mac documentation changes, added docs for 'ic' module
- PC/make_nt.in: deleted
- test_time.py, test_strftime.py: tweaks to catch %Z (which may return
"")
- test_rotor.py: print b -> print `b`
- Tkinter.py: (tagOrId) -> (tagOrId,)
- Tkinter.py: the Tk class now also has a configure() method and
friends (they have been moved to the Misc class to accomplish this).
- dict.get(key[, default]) returns dict[key] if it exists, or default
if it doesn't. The default defaults to None. This is quicker for
some applications than using either has_key() or try:...except
KeyError:....
- Tools/webchecker/: some small changes to webchecker.py; added
websucker.py (a simple web site mirroring script).
- Dictionary objects now have a get() method (also in UserDict.py).
dict.get(key, default) returns dict[key] if it exists and default
otherwise; default defaults to None.
- Tools/scripts/logmerge.py: print the author, too.
- Changes to import: support for "import a.b.c" is now built in. See
http://grail.cnri.reston.va.us/python/essays/packages.html
for more info. Most important deviations from "ni.py": __init__.py is
executed in the package's namespace instead of as a submodule; and
there's no support for "__" or "__domain__". Note that "ni.py" is not
changed to match this -- it is simply declared obsolete (while at the
same time, it is documented...:-( ).
Unfortunately, "ihooks.py" has not been upgraded (but see "knee.py"
for an example implementation of hierarchical module import written in
Python).
- More changes to import: the site.py module is now imported by
default when Python is initialized; use -S to disable it. The site.py
module extends the path with several more directories: site-packages
inside the lib/python1.5/ directory, site-python in the lib/
directory, and pathnames mentioned in *.pth files found in either of
those directories. See
http://grail.cnri.reston.va.us/python/essays/packages.html
for more info.
- Changes to standard library subdirectory names: those subdirectories
that are not packages have been renamed with a hypen in their name,
e.g. lib-tk, lib-stdwin, plat-win, plat-linux2, plat-sunos5, dos-8x3.
The test suite is now a package -- to run a test, you must now use
"import test.test_foo".
- A completely new re.py module is provided (thanks to Andrew
Kuchling, Tim Peters and Jeffrey Ollie) which uses Philip Hazel's
"pcre" re compiler and engine. For a while, the "old" re.py (which
was new in 1.5a3!) will be kept around as re1.py. The "old" regex
module and underlying parser and engine are still present -- while
regex is now officially obsolete, it will probably take several major
release cycles before it can be removed.
- The posix module now has a strerror() function which translates an
error code to a string.
- The emacs.py module (which was long obsolete) has been removed.
- The universal makefile Misc/Makefile.pre.in now features an
"install" target. By default, installed shared libraries go into
$exec_prefix/lib/python$VERSION/site-packages/.
- The install-sh script is installed with the other configuration
specific files (in the config/ subdirectory).
- It turns out whatsound.py and sndhdr.py were identical modules.
Since there's also an imghdr.py file, I propose to make sndhdr.py the
official one. For compatibility, whatsound.py imports * from
sndhdr.py.
- Class objects have a new attribute, __module__, giving the name of
the module in which they were declared. This is useful for pickle and
for printing the full name of a class exception.
- Many extension modules no longer issue a fatal error when their
initialization fails; the importing code now checks whether an error
occurred during module initialization, and correctly propagates the
exception to the import statement.
- Most extension modules now raise class-based exceptions (except when
-X is used).
- Subtle changes to PyEval_{Save,Restore}Thread(): always swap the
thread state -- just don't manipulate the lock if it isn't there.
- Fixed a bug in Python/getopt.c that made it do the wrong thing when
an option was a single '-'. Thanks to Andrew Kuchling.
- New module mimetypes.py will guess a MIME type from a filename's
extension.
- Windows: the DLL version is now settable via a resource rather than
being hardcoded. This can be used for "branding" a binary Python
distribution.
- urllib.py is now threadsafe -- it now uses re instead of regex, and
sys.exc_info() instead of sys.exc_{type,value}.
- Many other library modules that used to use
sys.exc_{type,value,traceback} are now more thread-safe by virtue of
using sys.exc_info().
- The functions in popen2 have an optional buffer size parameter.
Also, the command argument can now be either a string (passed to the
shell) or a list of arguments (passed directly to execv).
- Alas, the thread support for _tkinter released with 1.5a3 didn't
work. It's been rewritten. The bad news is that it now requires a
modified version of a file in the standard Tcl distribution, which you
must compile with a -I option pointing to the standard Tcl source
tree. For this reason, the thread support is disabled by default.
- The errno extension module adds two tables: errorcode maps errno
numbers to errno names (e.g. EINTR), and errorstr maps them to
message strings. (The latter is redundant because the new call
posix.strerror() now does the same, but alla...) (Marc-Andre Lemburg)
- The readline extension module now provides some interfaces to
internal readline routines that make it possible to write a completer
in Python. An example completer, rlcompleter.py, is provided.
When completing a simple identifier, it completes keywords,
built-ins and globals in __main__; when completing
NAME.NAME..., it evaluates (!) the expression up to the last
dot and completes its attributes.
It's very cool to do "import string" type "string.", hit the
completion key (twice), and see the list of names defined by
the string module!
Tip: to use the tab key as the completion key, call
readline.parse_and_bind("tab: complete")
- The traceback.py module has a new function tb_lineno() by Marc-Andre
Lemburg which extracts the line number from the linenumber table in
the code object. Apparently the traceback object doesn't contains the
right linenumber when -O is used. Rather than guessing whether -O is
on or off, the module itself uses tb_lineno() unconditionally.
- Fixed Demo/tkinter/matt/canvas-moving-or-creating.py: change bind()
to tag_bind() so it works again.
- The pystone script is now a standard library module. Example use:
"import test.pystone; test.pystone.main()".
- The import of the readline module in interactive mode is now also
attempted when -i is specified. (Yes, I know, giving in to Marc-Andre
Lemburg, who asked for this. :-)
- rfc822.py: Entirely rewritten parseaddr() function by Sjoerd
Mullender, to be closer to the standard. This fixes the getaddr()
method. Unfortunately, getaddrlist() is as broken as ever, since it
splits on commas without regard for RFC 822 quoting conventions.
- pprint.py: correctly emit trailing "," in singleton tuples.
- _tkinter.c: export names for its type objects, TkappType and
TkttType.
- pickle.py: use __module__ when defined; fix a particularly hard to
reproduce bug that confuses the memo when temporary objects are
returned by custom pickling interfaces; and a semantic change: when
unpickling the instance variables of an instance, use
inst.__dict__.update(value) instead of a for loop with setattr() over
the value.keys(). This is more consistent (the pickling doesn't use
getattr() either but pickles inst.__dict__) and avoids problems with
instances that have a __setattr__ hook. But it *is* a semantic change
(because the setattr hook is no longer used). So beware!
- config.h is now installed (at last) in
$exec_prefix/include/python1.5/. For most sites, this means that it
is actually in $prefix/include/python1.5/, with all the other Python
include files, since $prefix and $exec_prefix are the same by
default.
- The imp module now supports parts of the functionality to implement
import of hierarchical module names. It now supports find_module()
and load_module() for all types of modules. Docstrings have been
added for those functions in the built-in imp module that are still
relevant (some old interfaces are obsolete). For a sample
implementation of hierarchical module import in Python, see the new
library module knee.py.
- The % operator on string objects now allows arbitrary nested parens
in a %(...)X style format. (Brad Howes)
- Reverse the order in which Setup and Setup.local are passed to the
makesetup script. This allows variable definitions in Setup.local to
override definitions in Setup. (But you'll still have to edit Setup
if you want to disable modules that are enabled by default, or if such
modules need non-standard options.)
- Added PyImport_ImportModuleEx(name, globals, locals, fromlist); this
is like PyImport_ImporModule(name) but receives the globals and locals
dict and the fromlist arguments as well. (The name is a char*; the
others are PyObject*s).
- The 'p' format in the struct extension module alloded to above is
new in 1.5a4.
- The types.py module now uses try-except in a few places to make it
more likely that it can be imported in restricted mode. Some type
names are undefined in that case, e.g. CodeType (inaccessible),
FileType (not always accessible), and TracebackType and FrameType
(inaccessible).
- In urllib.py: added separate administration of temporary files
created y URLopener.retrieve() so cleanup() can properly remove them.
The old code removed everything in tempcache which was a bad idea if
the user had passed a non-temp file into it. Also, in basejoin(),
interpret relative paths starting in "../". This is necessary if the
server uses symbolic links.
- The Windows build procedure and project files are now based on
Microsoft Visual C++ 5.x. The build now takes place in the PCbuild
directory. It is much more robust, and properly builds separate Debug
and Release versions. (The installer will be added shortly.)
- Added casts and changed some return types in regexpr.c to avoid
compiler warnings or errors on some platforms.
- The AIX build tools for shared libraries now supports VPATH. (Donn
Cave)
- By default, disable the "portable" multimedia modules audioop,
imageop, and rgbimg, since they don't work on 64-bit platforms.
- Fixed a nasty bug in cStringIO.c when code was actually using the
close() method (the destructors would try to free certain fields a
second time).
- For those who think they need it, there's a "user.py" module. This
is *not* imported by default, but can be imported to run user-specific
setup commands, ~/.pythonrc.py.
- Various speedups suggested by Fredrik Lundh, Marc-Andre Lemburg,
Vladimir Marangozov, and others.
- Added os.altsep; this is '/' on DOS/Windows, and None on systems
with a sane filename syntax.
- os.py: Write out the dynamic OS choice, to avoid exec statements.
Adding support for a new OS is now a bit more work, but I bet that
'dos' or 'nt' will cover most situations...
- The obsolete exception AccessError is now really gone.
- Tools/faqwiz/: New installation instructions show how to maintain
multiple FAQs. Removed bootstrap script from end of faqwiz.py module.
Added instructions to bootstrap script, too. Version bumped to 0.8.1.
Added <html>...</html> feature suggested by Skip Montanaro. Added
leading text for Roulette, default to 'Hit Reload ...'. Fix typo in
default SRCDIR.
- Documentation for the relatively new modules "keyword" and "symbol"
has been added (to the end of the section on the parser extension
module).
- In module bisect.py, but functions have two optional argument 'lo'
and 'hi' which allow you to specify a subsequence of the array to
operate on.
- In ftplib.py, changed most methods to return their status (even when
it is always "200 OK") rather than swallowing it.
- main() now calls setlocale(LC_ALL, ""), if setlocale() and
<locale.h> are defined.
- Changes to configure.in, the configure script, and both
Makefile.pre.in files, to support SGI's SGI_ABI platform selection
environment variable.
======================================================================
From 1.4 to 1.5a3
=================
Security
--------
- If you are using the setuid script C wrapper (Misc/setuid-prog.c),
please use the new version. The old version has a huge security leak.
Miscellaneous
-------------
- Because of various (small) incompatible changes in the Python
bytecode interpreter, the magic number for .pyc files has changed
again.
- The default module search path is now much saner. Both on Unix and
Windows, it is essentially derived from the path to the executable
(which can be overridden by setting the environment variable
$PYTHONHOME). The value of $PYTHONPATH on Windows is now inserted in
front of the default path, like in Unix (instead of overriding the
default path). On Windows, the directory containing the executable is
added to the end of the path.
- A new version of python-mode.el for Emacs has been included. Also,
a new file ccpy-style.el has been added to configure Emacs cc-mode for
the preferred style in Python C sources.
- On Unix, when using sys.argv[0] to insert the script directory in
front of sys.path, expand a symbolic link. You can now install a
program in a private directory and have a symbolic link to it in a
public bin directory, and it will put the private directory in the
module search path. Note that the symlink is expanded in sys.path[0]
but not in sys.argv[0], so you can still tell the name by which you
were invoked.
- It is now recommended to use ``#!/usr/bin/env python'' instead of
``#!/usr/local/bin/python'' at the start of executable scripts, except
for CGI scripts. It has been determined that the use of /usr/bin/env
is more portable than that of /usr/local/bin/python -- scripts almost
never have to be edited when the Python interpreter lives in a
non-standard place. Note that this doesn't work for CGI scripts since
the python executable often doesn't live in the HTTP server's default
search path.
- The silly -s command line option and the corresponding
PYTHONSUPPRESS environment variable (and the Py_SuppressPrint global
flag in the Python/C API) are gone.
- Most problems on 64-bit platforms should now be fixed. Andrew
Kuchling helped. Some uncommon extension modules are still not
clean (image and audio ops?).
- Fixed a bug where multiple anonymous tuple arguments would be mixed up
when using the debugger or profiler (reported by Just van Rossum).
The simplest example is ``def f((a,b),(c,d)): print a,b,c,d''; this
would print the wrong value when run under the debugger or profiler.
- The hacks that the dictionary implementation used to speed up
repeated lookups of the same C string were removed; these were a
source of subtle problems and don't seem to serve much of a purpose
any longer.
- All traces of support for the long dead access statement have been
removed from the sources.
- Plugged the two-byte memory leak in the tokenizer when reading an
interactive EOF.
- There's a -O option to the interpreter that removes SET_LINENO
instructions and assert statements (see below); it uses and produces
.pyo files instead of .pyc files. The speedup is only a few percent
in most cases. The line numbers are still available in the .pyo file,
as a separate table (which is also available in .pyc files). However,
the removal of the SET_LINENO instructions means that the debugger
(pdb) can't set breakpoints on lines in -O mode. The traceback module
contains a function to extract a line number from the code object
referenced in a traceback object. In the future it should be possible
to write external bytecode optimizers that create better optimized
.pyo files, and there should be more control over optimization;
consider the -O option a "teaser". Without -O, the assert statement
actually generates code that first checks __debug__; if this variable
is false, the assertion is not checked. __debug__ is a built-in
variable whose value is initialized to track the -O flag (it's true
iff -O is not specified). With -O, no code is generated for assert
statements, nor for code of the form ``if __debug__: <something>''.
Sorry, no further constant folding happens.
Performance
-----------
- It's much faster (almost twice for pystone.py -- see
Tools/scripts). See the entry on string interning below.
- Some speedup by using separate free lists for method objects (both
the C and the Python variety) and for floating point numbers.
- Big speedup by allocating frame objects with a single malloc() call.
The Python/C API for frames is changed (you shouldn't be using this
anyway).
- Significant speedup by inlining some common opcodes for common operand
types (e.g. i+i, i-i, and list[i]). Fredrik Lundh.
- Small speedup by reordering the method tables of some common
objects (e.g. list.append is now first).
- Big optimization to the read() method of file objects. A read()
without arguments now attempts to use fstat to allocate a buffer of
the right size; for pipes and sockets, it will fall back to doubling
the buffer size. While that the improvement is real on all systems,
it is most dramatic on Windows.
Documentation
-------------
- Many new pieces of library documentation were contributed, mostly by
Andrew Kuchling. Even cmath is now documented! There's also a
chapter of the library manual, "libundoc.tex", which provides a
listing of all undocumented modules, plus their status (e.g. internal,
obsolete, or in need of documentation). Also contributions by Sue
Williams, Skip Montanaro, and some module authors who succumbed to
pressure to document their own contributed modules :-). Note that
printing the documentation now kills fewer trees -- the margins have
been reduced.
- I have started documenting the Python/C API. Unfortunately this project
hasn't been completed yet. It will be complete before the final release of
Python 1.5, though. At the moment, it's better to read the LaTeX source
than to attempt to run it through LaTeX and print the resulting dvi file.
- The posix module (and hence os.py) now has doc strings! Thanks to Neil
Schemenauer. I received a few other contributions of doc strings. In most
other places, doc strings are still wishful thinking...
Language changes
----------------
- Private variables with leading double underscore are now a permanent
feature of the language. (These were experimental in release 1.4. I have
favorable experience using them; I can't label them "experimental"
forever.)
- There's new string literal syntax for "raw strings". Prefixing a string
literal with the letter r (or R) disables all escape processing in the
string; for example, r'\n' is a two-character string consisting of a
backslash followed by the letter n. This combines with all forms of string
quotes; it is actually useful for triple quoted doc strings which might
contain references to \n or \t. An embedded quote prefixed with a
backslash does not terminate the string, but the backslash is still
included in the string; for example, r'\'' is a two-character string
consisting of a backslash and a quote. (Raw strings are also
affectionately known as Robin strings, after their inventor, Robin
Friedrich.)
- There's a simple assert statement, and a new exception
AssertionError. For example, ``assert foo > 0'' is equivalent to ``if
not foo > 0: raise AssertionError''. Sorry, the text of the asserted
condition is not available; it would be too complicated to generate
code for this (since the code is generated from a parse tree).
However, the text is displayed as part of the traceback!
- The raise statement has a new feature: when using "raise SomeClass,
somevalue" where somevalue is not an instance of SomeClass, it
instantiates SomeClass(somevalue). In 1.5a4, if somevalue is an
instance of a *derived* class of SomeClass, the exception class raised
is set to somevalue.__class__, and SomeClass is ignored after that.
- Duplicate keyword arguments are now detected at compile time;
f(a=1,a=2) is now a syntax error.
Changes to builtin features
---------------------------
- There's a new exception FloatingPointError (used only by Lee Busby's
patches to catch floating point exceptions, at the moment).
- The obsolete exception ConflictError (presumably used by the long
obsolete access statement) has been deleted.
- There's a new function sys.exc_info() which returns the tuple
(sys.exc_type, sys.exc_value, sys.exc_traceback) in a thread-safe way.
- There's a new variable sys.executable, pointing to the executable file
for the Python interpreter.
- The sort() methods for lists no longer uses the C library qsort(); I
wrote my own quicksort implementation, with lots of help (in the form
of a kind of competition) from Tim Peters. This solves a bug in
dictionary comparisons on some Solaris versions when Python is built
with threads, and makes sorting lists even faster.
- The semantics of comparing two dictionaries have changed, to make
comparison of unequal dictionaries faster. A shorter dictionary is
always considered smaller than a larger dictionary. For dictionaries
of the same size, the smallest differing element determines the
outcome (which yields the same results as before in this case, without
explicit sorting). Thanks to Aaron Watters for suggesting something
like this.
- The semantics of try-except have changed subtly so that calling a
function in an exception handler that itself raises and catches an
exception no longer overwrites the sys.exc_* variables. This also
alleviates the problem that objects referenced in a stack frame that
caught an exception are kept alive until another exception is caught
-- the sys.exc_* variables are restored to their previous value when
returning from a function that caught an exception.
- There's a new "buffer" interface. Certain objects (e.g. strings and
arrays) now support the "buffer" protocol. Buffer objects are acceptable
whenever formerly a string was required for a write operation; mutable
buffer objects can be the target of a read operation using the call
f.readinto(buffer). A cool feature is that regular expression matching now
also work on array objects. Contribution by Jack Jansen. (Needs
documentation.)
- String interning: dictionary lookups are faster when the lookup
string object is the same object as the key in the dictionary, not
just a string with the same value. This is done by having a pool of
"interned" strings. Most names generated by the interpreter are now
automatically interned, and there's a new built-in function intern(s)
that returns the interned version of a string. Interned strings are
not a different object type, and interning is totally optional, but by
interning most keys a speedup of about 15% was obtained for the
pystone benchmark.
- Dictionary objects have several new methods; clear() and copy() have
the obvious semantics, while update(d) merges the contents of another
dictionary d into this one, overriding existing keys. The dictionary
implementation file is now called dictobject.c rather than the
confusing mappingobject.c.
- The intrinsic function dir() is much smarter; it looks in __dict__,
__members__ and __methods__.
- The intrinsic functions int(), long() and float() can now take a
string argument and then do the same thing as string.atoi(),
string.atol(), and string.atof(). No second 'base' argument is
allowed, and complex() does not take a string (nobody cared enough).
- When a module is deleted, its globals are now deleted in two phases.
In the first phase, all variables whose name begins with exactly one
underscore are replaced by None; in the second phase, all variables
are deleted. This makes it possible to have global objects whose
destructors depend on other globals. The deletion order within each
phase is still random.
- It is no longer an error for a function to be called without a
global variable __builtins__ -- an empty directory will be provided
by default.
- Guido's corollary to the "Don Beaudry hook": it is now possible to
do metaprogramming by using an instance as a base class. Not for the
faint of heart; and undocumented as yet, but basically if a base class
is an instance, its class will be instantiated to create the new
class. Jim Fulton will love it -- it also works with instances of his
"extension classes", since it is triggered by the presence of a
__class__ attribute on the purported base class. See
Demo/metaclasses/index.html for an explanation and see that directory
for examples.
- Another change is that the Don Beaudry hook is now invoked when
*any* base class is special. (Up to 1.5a3, the *last* special base
class is used; in 1.5a4, the more rational choice of the *first*
special base class is used.)
- New optional parameter to the readlines() method of file objects.
This indicates the number of bytes to read (the actual number of bytes
read will be somewhat larger due to buffering reading until the end of
the line). Some optimizations have also been made to speed it up (but
not as much as read()).
- Complex numbers no longer have the ".conj" pseudo attribute; use
z.conjugate() instead, or complex(z.real, -z.imag). Complex numbers
now *do* support the __members__ and __methods__ special attributes.
- The complex() function now looks for a __complex__() method on class
instances before giving up.
- Long integers now support arbitrary shift counts, so you can now
write 1L<<1000000, memory permitting. (Python 1.4 reports "outrageous
shift count for this.)
- The hex() and oct() functions have been changed so that for regular
integers, they never emit a minus sign. For example, on a 32-bit
machine, oct(-1) now returns '037777777777' and hex(-1) returns
'0xffffffff'. While this may seem inconsistent, it is much more
useful. (For long integers, a minus sign is used as before, to fit
the result in memory :-)
- The hash() function computes better hashes for several data types,
including strings, floating point numbers, and complex numbers.
New extension modules
---------------------
- New extension modules cStringIO.c and cPickle.c, written by Jim
Fulton and other folks at Digital Creations. These are much more
efficient than their Python counterparts StringIO.py and pickle.py,
but don't support subclassing. cPickle.c clocks up to 1000 times
faster than pickle.py; cStringIO.c's improvement is less dramatic but
still significant.
- New extension module zlibmodule.c, interfacing to the free zlib
library (gzip compatible compression). There's also a module gzip.py
which provides a higher level interface. Written by Andrew Kuchling
and Jeremy Hylton.
- New module readline; see the "miscellaneous" section above.
- New Unix extension module resource.c, by Jeremy Hylton, provides
access to getrlimit(), getrusage(), setrusage(), getpagesize(), and
related symbolic constants.
- New extension puremodule.c, by Barry Warsaw, which interfaces to the
Purify(TM) C API. See also the file Misc/PURIFY.README. It is also
possible to enable Purify by simply setting the PURIFY Makefile
variable in the Modules/Setup file.
Changes in extension modules
----------------------------
- The struct extension module has several new features to control byte
order and word size. It supports reading and writing IEEE floats even
on platforms where this is not the native format. It uses uppercase
format codes for unsigned integers of various sizes (always using
Python long ints for 'I' and 'L'), 's' with a size prefix for strings,
and 'p' for "Pascal strings" (with a leading length byte, included in
the size; blame Hannu Krosing; new in 1.5a4). A prefix '>' forces
big-endian data and '<' forces little-endian data; these also select
standard data sizes and disable automatic alignment (use pad bytes as
needed).
- The array module supports uppercase format codes for unsigned data
formats (like the struct module).
- The fcntl extension module now exports the needed symbolic
constants. (Formerly these were in FCNTL.py which was not available
or correct for all platforms.)
- The extension modules dbm, gdbm and bsddb now check that the
database is still open before making any new calls.
- The dbhash module is no more. Use bsddb instead. (There's a third
party interface for the BSD 2.x code somewhere on the web; support for
bsddb will be deprecated.)
- The gdbm module now supports a sync() method.
- The socket module now has some new functions: getprotobyname(), and
the set {ntoh,hton}{s,l}().
- Various modules now export their type object: socket.SocketType,
array.ArrayType.
- The socket module's accept() method now returns unknown addresses as
a tuple rather than raising an exception. (This can happen in
promiscuous mode.) Theres' also a new function getprotobyname().
- The pthread support for the thread module now works on most platforms.
- STDWIN is now officially obsolete. Support for it will eventually
be removed from the distribution.
- The binascii extension module is now hopefully fully debugged.
(XXX Oops -- Fredrik Lundh promised me a uuencode fix that I never
received.)
- audioop.c: added a ratecv() function; better handling of overflow in
add().
- posixmodule.c: now exports the O_* flags (O_APPEND etc.). On
Windows, also O_TEXT and O_BINARY. The 'error' variable (the
exception is raises) is renamed -- its string value is now "os.error",
so newbies don't believe they have to import posix (or nt) to catch
it when they see os.error reported as posix.error. The execve()
function now accepts any mapping object for the environment.
- A new version of the al (audio library) module for SGI was
contributed by Sjoerd Mullender.
- The regex module has a new function get_syntax() which retrieves the
syntax setting set by set_syntax(). The code was also sanitized,
removing worries about unclean error handling. See also below for its
successor, re.py.
- The "new" module (which creates new objects of various types) once
again has a fully functioning new.function() method. Dangerous as
ever! Also, new.code() has several new arguments.
- A problem has been fixed in the rotor module: on systems with signed
characters, rotor-encoded data was not portable when the key contained
8-bit characters. Also, setkey() now requires its argument rather
than having broken code to default it.
- The sys.builtin_module_names variable is now a tuple. Another new
variables in sys is sys.executable (the full path to the Python
binary, if known).
- The specs for time.strftime() have undergone some revisions. It
appears that not all format characters are supported in the same way
on all platforms. Rather than reimplement it, we note these
differences in the documentation, and emphasize the shared set of
features. There's also a thorough test set (that occasionally finds
problems in the C library implementation, e.g. on some Linuxes),
thanks to Skip Montanaro.
- The nis module seems broken when used with NIS+; unfortunately
nobody knows how to fix it. It should still work with old NIS.
New library modules
-------------------
- New (still experimental) Perl-style regular expression module,
re.py, which uses a new interface for matching as well as a new
syntax; the new interface avoids the thread-unsafety of the regex
interface. This comes with a helper extension reopmodule.c and vastly
rewritten regexpr.c. Most work on this was done by Jeffrey Ollie, Tim
Peters, and Andrew Kuchling. See the documentation libre.tex. In
1.5, the old regex module is still fully supported; in the future, it
will become obsolete.
- New module gzip.py; see zlib above.
- New module keyword.py exports knowledge about Python's built-in
keywords. (New version by Ka-Ping Yee.)
- New module pprint.py (with documentation) which supports
pretty-printing of lists, tuples, & dictionaries recursively. By Fred
Drake.
- New module code.py. The function code.compile_command() can
determine whether an interactively entered command is complete or not,
distinguishing incomplete from invalid input. (XXX Unfortunately,
this seems broken at this moment, and I don't have the time to fix
it. It's probably better to add an explicit interface to the parser
for this.)
- There is now a library module xdrlib.py which can read and write the
XDR data format as used by Sun RPC, for example. It uses the struct
module.
Changes in library modules
--------------------------
- Module codehack.py is now completely obsolete.
- The pickle.py module has been updated to make it compatible with the
new binary format that cPickle.c produces. By default it produces the
old all-ASCII format compatible with the old pickle.py, still much
faster than pickle.py; it will read both formats automatically. A few
other updates have been made.
- A new helper module, copy_reg.py, is provided to register extensions
to the pickling code.
- Revamped module tokenize.py is much more accurate and has an
interface that makes it a breeze to write code to colorize Python
source code. Contributed by Ka-Ping Yee.
- In ihooks.py, ModuleLoader.load_module() now closes the file under
all circumstances.
- The tempfile.py module has a new class, TemporaryFile, which creates
an open temporary file that will be deleted automatically when
closed. This works on Windows and MacOS as well as on Unix. (Jim
Fulton.)
- Changes to the cgi.py module: Most imports are now done at the
top of the module, which provides a speedup when using ni (Jim
Fulton). The problem with file upload to a Windows platform is solved
by using the new tempfile.TemporaryFile class; temporary files are now
always opened in binary mode (Jim Fulton). The cgi.escape() function
now takes an optional flag argument that quotes '"' to '"'. It
is now possible to invoke cgi.py from a command line script, to test
cgi scripts more easily outside an http server. There's an optional
limit to the size of uploads to POST (Skip Montanaro). Added a
'strict_parsing' option to all parsing functions (Jim Fulton). The
function parse_qs() now uses urllib.unquote() on the name as well as
the value of fields (Clarence Gardner). The FieldStorage class now
has a __len__() method.
- httplib.py: the socket object is no longer closed; all HTTP/1.*
responses are now accepted; and it is now thread-safe (by not using
the regex module).
- BaseHTTPModule.py: treat all HTTP/1.* versions the same.
- The popen2.py module is now rewritten using a class, which makes
access to the standard error stream and the process id of the
subprocess possible.
- Added timezone support to the rfc822.py module, in the form of a
getdate_tz() method and a parsedate_tz() function; also a mktime_tz().
Also added recognition of some non-standard date formats, by Lars
Wirzenius, and RFC 850 dates (Chris Lawrence).
- mhlib.py: various enhancements, including almost compatible parsing
of message sequence specifiers without invoking a subprocess. Also
added a createmessage() method by Lars Wirzenius.
- The StringIO.StringIO class now supports readline(nbytes). (Lars
Wirzenius.) (Of course, you should be using cStringIO for performance.)
- UserDict.py supports the new dictionary methods as well.
- Improvements for whrandom.py by Tim Peters: use 32-bit arithmetic to
speed it up, and replace 0 seed values by 1 to avoid degeneration.
A bug was fixed in the test for invalid arguments.
- Module ftplib.py: added support for parsing a .netrc file (Fred
Drake). Also added an ntransfercmd() method to the FTP class, which
allows access to the expected size of a transfer when available, and a
parse150() function to the module which parses the corresponding 150
response.
- urllib.py: the ftp cache is now limited to 10 entries. Added
quote_plus() and unquote_plus() functions which are like quote() and
unquote() but also replace spaces with '+' or vice versa, for
encoding/decoding CGI form arguments. Catch all errors from the ftp
module. HTTP requests now add the Host: header line. The proxy
variable names are now mapped to lower case, for Windows. The
spliturl() function no longer erroneously throws away all data past
the first newline. The basejoin() function now intereprets "../"
correctly. I *believe* that the problems with "exception raised in
__del__" under certain circumstances have been fixed (mostly by
changes elsewher in the interpreter).
- In urlparse.py, there is a cache for results in urlparse.urlparse();
its size limit is set to 20. Also, new URL schemes shttp, https, and
snews are "supported".
- shelve.py: use cPickle and cStringIO when available. Also added
a sync() method, which calls the database's sync() method if there is
one.
- The mimetools.py module now uses the available Python modules for
decoding quoted-printable, uuencode and base64 formats, rather than
creating a subprocess.
- The python debugger (pdb.py, and its base class bdb.py) now support
conditional breakpoints. See the docs.
- The modules base64.py, uu.py and quopri.py can now be used as simple
command line utilities.
- Various small fixes to the nntplib.py module that I can't bother to
document in detail.
- Sjoerd Mullender's mimify.py module now supports base64 encoding and
includes functions to handle the funny encoding you sometimes see in mail
headers. It is now documented.
- mailbox.py: Added BabylMailbox. Improved the way the mailbox is
gotten from the environment.
- Many more modules now correctly open files in binary mode when this
is necessary on non-Unix platforms.
- The copying functions in the undocumented module shutil.py are
smarter.
- The Writer classes in the formatter.py module now have a flush()
method.
- The sgmllib.py module accepts hyphens and periods in the middle of
attribute names. While this is against the SGML standard, there is
some HTML out there that uses this...
- The interface for the Python bytecode disassembler module, dis.py,
has been enhanced quite a bit. There's now one main function,
dis.dis(), which takes almost any kind of object (function, module,
class, instance, method, code object) and disassembles it; without
arguments it disassembles the last frame of the last traceback. The
other functions have changed slightly, too.
- The imghdr.py module recognizes new image types: BMP, PNG.
- The string.py module has a new function replace(str, old, new,
[maxsplit]) which does substring replacements. It is actually
implemented in C in the strop module. The functions [r]find() an
[r]index() have an optional 4th argument indicating the end of the
substring to search, alsoo implemented by their strop counterparts.
(Remember, never import strop -- import string uses strop when
available with zero overhead.)
- The string.join() function now accepts any sequence argument, not
just lists and tuples.
- The string.maketrans() requires its first two arguments to be
present. The old version didn't require them, but there's not much
point without them, and the documentation suggests that they are
required, so we fixed the code to match the documentation.
- The regsub.py module has a function clear_cache(), which clears its
internal cache of compiled regular expressions. Also, the cache now
takes the current syntax setting into account. (However, this module
is now obsolete -- use the sub() or subn() functions or methods in the
re module.)
- The undocumented module Complex.py has been removed, now that Python
has built-in complex numbers. A similar module remains as
Demo/classes/Complex.py, as an example.
Changes to the build process
----------------------------
- The way GNU readline is configured is totally different. The
--with-readline configure option is gone. It is now an extension
module, which may be loaded dynamically. You must enable it (and
specify the correct linraries to link with) in the Modules/Setup file.
Importing the module installs some hooks which enable command line
editing. When the interpreter shell is invoked interactively, it
attempts to import the readline module; when this fails, the default
input mechanism is used. The hook variables are PyOS_InputHook and
PyOS_ReadlineFunctionPointer. (Code contributed by Lee Busby, with
ideas from William Magro.)
- New build procedure: a single library, libpython1.5.a, is now built,
which contains absolutely everything except for a one-line main()
program (which calls Py_Main(argc, argv) to start the interpreter
shell). This makes life much simpler for applications that need to
embed Python. The serial number of the build is now included in the
version string (sys.version).
- As far as I can tell, neither gcc -Wall nor the Microsoft compiler
emits a single warning any more when compiling Python.
- A number of new Makefile variables have been added for special
situations, e.g. LDLAST is appended to the link command. These are
used by editing the Makefile or passing them on the make command
line.
- A set of patches from Lee Busby has been integrated that make it
possible to catch floating point exceptions. Use the configure option
--with-fpectl to enable the patches; the extension modules fpectl and
fpetest provide control to enable/disable and test the feature,
respectively.
- The support for shared libraries under AIX is now simpler and more
robust. Thanks to Vladimir Marangozov for revamping his own patches!
- The Modules/makesetup script now reads a file Setup.local as well as
a file Setup. Most changes to the Setup script can be done by editing
Setup.local instead, which makes it easier to carry a particular setup
over from one release to the next.
- The Modules/makesetup script now copies any "include" lines it
encounters verbatim into the output Makefile. It also recognizes .cxx
and .cpp as C++ source files.
- The configure script is smarter about C compiler options; e.g. with
gcc it uses -O2 and -g when possible, and on some other platforms it
uses -Olimit 1500 to avoid a warning from the optimizer about the main
loop in ceval.c (which has more than 1000 basic blocks).
- The configure script now detects whether malloc(0) returns a NULL
pointer or a valid block (of length zero). This avoids the nonsense
of always adding one byte to all malloc() arguments on most platforms.
- The configure script has a new option, --with-dec-threads, to enable
DEC threads on DEC Alpha platforms. Also, --with-threads is now an
alias for --with-thread (this was the Most Common Typo in configure
arguments).
- Many changes in Doc/Makefile; amongst others, latex2html is now used
to generate HTML from all latex documents.
Change to the Python/C API
--------------------------
- Because some interfaces have changed, the PYTHON_API macro has been
bumped. Most extensions built for the old API version will still run,
but I can't guarantee this. Python prints a warning message on
version mismatches; it dumps core when the version mismatch causes a
serious problem :-)
- I've completed the Grand Renaming, with the help of Roger Masse and
Barry Warsaw. This makes reading or debugging the code much easier.
Many other unrelated code reorganizations have also been carried out.
The allobjects.h header file is gone; instead, you would have to
include Python.h followed by rename2.h. But you're better off running
Tools/scripts/fixcid.py -s Misc/RENAME on your source, so you can omit
the rename2.h; it will disappear in the next release.
- Various and sundry small bugs in the "abstract" interfaces have been
fixed. Thanks to all the (involuntary) testers of the Python 1.4
version! Some new functions have been added, e.g. PySequence_List(o),
equivalent to list(o) in Python.
- New API functions PyLong_FromUnsignedLong() and
PyLong_AsUnsignedLong().
- The API functions in the file cgensupport.c are no longer
supported. This file has been moved to Modules and is only ever
compiled when the SGI specific 'gl' module is built.
- PyObject_Compare() can now raise an exception. Check with
PyErr_Occurred(). The comparison function in an object type may also
raise an exception.
- The slice interface uses an upper bound of INT_MAX when no explicit
upper bound is given (e.x. for a[1:]). It used to ask the object for
its length and do the calculations.
- Support for multiple independent interpreters. See Doc/api.tex,
functions Py_NewInterpreter() and Py_EndInterpreter(). Since the
documentation is incomplete, also see the new Demo/pysvr example
(which shows how to use these in a threaded application) and the
source code.
- There is now a Py_Finalize() function which "de-initializes"
Python. It is possible to completely restart the interpreter
repeatedly by calling Py_Finalize() followed by Py_Initialize(). A
change of functionality in Py_Initialize() means that it is now a
fatal error to call it while the interpreter is already initialized.
The old, half-hearted Py_Cleanup() routine is gone. Use of Py_Exit()
is deprecated (it is nothing more than Py_Finalize() followed by
exit()).
- There are no known memory leaks left. While Py_Finalize() doesn't
free *all* allocated memory (some of it is hard to track down),
repeated calls to Py_Finalize() and Py_Initialize() do not create
unaccessible heap blocks.
- There is now explicit per-thread state. (Inspired by, but not the
same as, Greg Stein's free threading patches.)
- There is now better support for threading C applications. There are
now explicit APIs to manipulate the interpreter lock. Read the source
or the Demo/pysvr example; the new functions are
PyEval_{Acquire,Release}{Lock,Thread}().
- The test macro DEBUG has changed to Py_DEBUG, to avoid interference
with other libraries' DEBUG macros. Likewise for any other test
macros that didn't yet start with Py_.
- New wrappers around malloc() and friends: Py_Malloc() etc. call
malloc() and call PyErr_NoMemory() when it fails; PyMem_Malloc() call
just malloc(). Use of these wrappers could be essential if multiple
memory allocators exist (e.g. when using certain DLL setups under
Windows). (Idea by Jim Fulton.)
- New C API PyImport_Import() which uses whatever __import__() hook
that is installed for the current execution environment. By Jim
Fulton.
- It is now possible for an extension module's init function to fail
non-fatally, by calling one of the PyErr_* functions and returning.
- The PyInt_AS_LONG() and PyFloat_AS_DOUBLE() macros now cast their
argument to the proper type, like the similar PyString macros already
did. (Suggestion by Marc-Andre Lemburg.) Similar for PyList_GET_SIZE
and PyList_GET_ITEM.
- Some of the Py_Get* function, like Py_GetVersion() (but not yet
Py_GetPath()) are now declared as returning a const char *. (More
should follow.)
- Changed the run-time library to check for exceptions after object
comparisons. PyObject_Compare() can now return an exception; use
PyErr_Occurred() to check (there is *no* special return value).
- PyFile_WriteString() and Py_Flushline() now return error indicators
instead of clearing exceptions. This fixes an obscure bug where using
these would clear a pending exception, discovered by Just van Rossum.
- There's a new function, PyArg_ParseTupleAndKeywords(), which parses
an argument list including keyword arguments. Contributed by Geoff
Philbrick.
- PyArg_GetInt() is gone.
- It's no longer necessary to include graminit.h when calling one of
the extended parser API functions. The three public grammar start
symbols are now in Python.h as Py_single_input, Py_file_input, and
Py_eval_input.
- The CObject interface has a new function,
PyCObject_Import(module, name). It calls PyCObject_AsVoidPtr()
on the object referenced by "module.name".
Tkinter
-------
- On popular demand, _tkinter once again installs a hook for readline
that processes certain Tk events while waiting for the user to type
(using PyOS_InputHook).
- A patch by Craig McPheeters plugs the most obnoxious memory leaks,
caused by command definitions referencing widget objects beyond their
lifetime.
- New standard dialog modules: tkColorChooser.py, tkCommonDialog.py,
tkMessageBox.py, tkFileDialog.py, tkSimpleDialog.py These interface
with the new Tk dialog scripts, and provide more "native platform"
style file selection dialog boxes on some platforms. Contributed by
Fredrik Lundh.
- Tkinter.py: when the first Tk object is destroyed, it sets the
hiddel global _default_root to None, so that when another Tk object is
created it becomes the new default root. Other miscellaneous
changes and fixes.
- The Image class now has a configure method.
- Added a bunch of new winfo options to Tkinter.py; we should now be
up to date with Tk 4.2. The new winfo options supported are:
mananger, pointerx, pointerxy, pointery, server, viewable, visualid,
visualsavailable.
- The broken bind() method on Canvas objects defined in the Canvas.py
module has been fixed. The CanvasItem and Group classes now also have
an unbind() method.
- The problem with Tkinter.py falling back to trying to import
"tkinter" when "_tkinter" is not found has been fixed -- it no longer
tries "tkinter", ever. This makes diagnosing the problem "_tkinter
not configured" much easier and will hopefully reduce the newsgroup
traffic on this topic.
- The ScrolledText module once again supports the 'cnf' parameter, to
be compatible with the examples in Mark Lutz' book (I know, I know,
too late...)
- The _tkinter.c extension module has been revamped. It now support
Tk versions 4.1 through 8.0; support for 4.0 has been dropped. It
works well under Windows and Mac (with the latest Tk ports to those
platforms). It also supports threading -- it is safe for one
(Python-created) thread to be blocked in _tkinter.mainloop() while
other threads modify widgets. To make the changes visible, those
threads must use update_idletasks()method. (The patch for threading
in 1.5a3 was broken; in 1.5a4, it is back in a different version,
which requires access to the Tcl sources to get it to work -- hence it
is disabled by default.)
- A bug in _tkinter.c has been fixed, where Split() with a string
containing an unmatched '"' could cause an exception or core dump.
- Unfortunately, on Windows and Mac, Tk 8.0 no longer supports
CreateFileHandler, so _tkinter.createfilehandler is not available on
those platforms when using Tk 8.0 or later. I will have to rethink
how to interface with Tcl's lower-level event mechanism, or with its
channels (which are like Python's file-like objects). Jack Jansen has
provided a fix for the Mac, so createfilehandler *is* actually
supported there; maybe I can adapt his fix for Windows.
Tools and Demos
---------------
- A new regression test suite is provided, which tests most of the
standard and built-in modules. The regression test is run by invoking
the script Lib/test/regrtest.py. Barry Warsaw wrote the test harnass;
he and Roger Masse contributed most of the new tests.
- New tool: faqwiz -- the CGI script that is used to maintain the
Python FAQ (http://grail.cnri.reston.va.us/cgi-bin/faqw.py). In
Tools/faqwiz.
- New tool: webchecker -- a simple extensible web robot that, when
aimed at a web server, checks that server for dead links. Available
are a command line utility as well as a Tkinter based GUI version. In
Tools/webchecker. A simplified version of this program is dissected
in my article in O'Reilly's WWW Journal, the issue on Scripting
Languages (Vol 2, No 2); Scripting the Web with Python (pp 97-120).
Includes a parser for robots.txt files by Skip Montanaro.
- New small tools: cvsfiles.py (prints a list of all files under CVS
n a particular directory tree), treesync.py (a rather Guido-specific
script to synchronize two source trees, one on Windows NT, the other
one on Unix under CVS but accessible from the NT box), and logmerge.py
(sort a collection of RCS or CVS logs by date). In Tools/scripts.
- The freeze script now also works under Windows (NT). Another
feature allows the -p option to be pointed at the Python source tree
instead of the installation prefix. This was loosely based on part of
xfreeze by Sam Rushing and Bill Tutt.
- New examples (Demo/extend) that show how to use the generic
extension makefile (Misc/Makefile.pre.in).
- Tools/scripts/h2py.py now supports C++ comments.
- Tools/scripts/pystone.py script is upgraded to version 1.1; there
was a bug in version 1.0 (distributed with Python 1.4) that leaked
memory. Also, in 1.1, the LOOPS variable is incremented to 10000.
- Demo/classes/Rat.py completely rewritten by Sjoerd Mullender.
Windows (NT and 95)
-------------------
- New project files for Developer Studio (Visual C++) 5.0 for Windows
NT (the old VC++ 4.2 Makefile is also still supported, but will
eventually be withdrawn due to its bulkiness).
- See the note on the new module search path in the "Miscellaneous" section
above.
- Support for Win32s (the 32-bit Windows API under Windows 3.1) is
basically withdrawn. If it still works for you, you're lucky.
- There's a new extension module, msvcrt.c, which provides various
low-level operations defined in the Microsoft Visual C++ Runtime Library.
These include locking(), setmode(), get_osfhandle(), set_osfhandle(), and
console I/O functions like kbhit(), getch() and putch().
- The -u option not only sets the standard I/O streams to unbuffered
status, but also sets them in binary mode. (This can also be done
using msvcrt.setmode(), by the way.)
- The, sys.prefix and sys.exec_prefix variables point to the directory
where Python is installed, or to the top of the source tree, if it was run
from there.
- The various os.path modules (posixpath, ntpath, macpath) now support
passing more than two arguments to the join() function, so
os.path.join(a, b, c) is the same as os.path.join(a, os.path.join(b,
c)).
- The ntpath module (normally used as os.path) supports ~ to $HOME
expansion in expanduser().
- The freeze tool now works on Windows.
- See also the Tkinter category for a sad note on
_tkinter.createfilehandler().
- The truncate() method for file objects now works on Windows.
- Py_Initialize() is no longer called when the DLL is loaded. You
must call it yourself.
- The time module's clock() function now has good precision through
the use of the Win32 API QueryPerformanceCounter().
- Mark Hammond will release Python 1.5 versions of PythonWin and his
other Windows specific code: the win32api extensions, COM/ActiveX
support, and the MFC interface.
Mac
---
- As always, the Macintosh port will be done by Jack Jansen. He will
make a separate announcement for the Mac specific source code and the
binary distribution(s) when these are ready.
======================================================================
=====================================
==> Release 1.4 (October 25 1996) <==
=====================================
(Starting in reverse chronological order:)
- Changed disclaimer notice.
- Added SHELL=/bin/sh to Misc/Makefile.pre.in -- some Make versions
default to the user's login shell.
- In Lib/tkinter/Tkinter.py, removed bogus binding of <Delete> in Text
widget, and bogus bspace() function.
- In Lib/cgi.py, bumped __version__ to 2.0 and restored a truncated
paragraph.
- Fixed the NT Makefile (PC/vc40.mak) for VC 4.0 to set /MD for all
subprojects, and to remove the (broken) experimental NumPy
subprojects.
- In Lib/py_compile.py, cast mtime to long() so it will work on Mac
(where os.stat() returns mtimes as floats.)
- Set self.rfile unbuffered (like self.wfile) in SocketServer.py, to
fix POST in CGIHTTPServer.py.
- Version 2.83 of Misc/python-mode.el for Emacs is included.
- In Modules/regexmodule.c, fixed symcomp() to correctly handle a new
group starting immediately after a group tag.
- In Lib/SocketServer.py, changed the mode for rfile to unbuffered.
- In Objects/stringobject.c, fixed the compare function to do the
first char comparison in unsigned mode, for consistency with the way
other characters are compared by memcmp().
- In Lib/tkinter/Tkinter.py, fixed Scale.get() to support floats.
- In Lib/urllib.py, fix another case where openedurl wasn't set.
(XXX Sorry, the rest is in totally random order. No time to fix it.)
- SyntaxError exceptions detected during code generation
(e.g. assignment to an expression) now include a line number.
- Don't leave trailing / or \ in script directory inserted in front of
sys.path.
- Added a note to Tools/scripts/classfix.py abouts its historical
importance.
- Added Misc/Makefile.pre.in, a universal Makefile for extensions
built outside the distribution.
- Rewritten Misc/faq2html.py, by Ka-Ping Yee.
- Install shared modules with mode 555 (needed for performance on some
platforms).
- Some changes to standard library modules to avoid calling append()
with more than one argument -- while supported, this should be
outlawed, and I don't want to set a bad example.
- bdb.py (and hence pdb.py) supports calling run() with a code object
instead of a code string.
- Fixed an embarrassing bug cgi.py which prevented correct uploading
of binary files from Netscape (which doesn't distinguish between
binary and text files). Also added dormant logging support, which
makes it easier to debug the cgi module itself.
- Added default writer to constructor of NullFormatter class.
- Use binary mode for socket.makefile() calls in ftplib.py.
- The ihooks module no longer "installs" itself upon import -- this
was an experimental feature that helped ironing out some bugs but that
slowed down code that imported it without the need to install it
(e.g. the rexec module). Also close the file in some cases and add
the __file__ attribute to loaded modules.
- The test program for mailbox.py is now more useful.
- Added getparamnames() to Message class in mimetools.py -- it returns
the names of parameters to the content-type header.
- Fixed a typo in ni that broke the loop stripping "__." from names.
- Fix sys.path[0] for scripts run via pdb.py's new main program.
- profile.py can now also run a script, like pdb.
- Fix a small bug in pyclbr -- don't add names starting with _ when
emulating from ... import *.
- Fixed a series of embarrassing typos in rexec's handling of standard
I/O redirection. Added some more "safe" built-in modules: cmath,
errno, operator.
- Fixed embarrassing typo in shelve.py.
- Added SliceType and EllipsisType to types.py.
- In urllib.py, added handling for error 301 (same as 302); added
geturl() method to get the URL after redirection.
- Fixed embarrassing typo in xdrlib.py. Also fixed typo in Setup.in
for _xdrmodule.c and removed redundant #include from _xdrmodule.c.
- Fixed bsddbmodule.c to add binary mode indicator on platforms that
have it. This should make it working on Windows NT.
- Changed last uses of #ifdef NT to #ifdef MS_WINDOWS or MS_WIN32,
whatever applies. Also rationalized some other tests for various MS
platforms.
- Added the sources for the NT installer script used for Python
1.4beta3. Not tested with this release, but better than nothing.
- A compromise in pickle's defenses against Trojan horses: a
user-defined function is now okay where a class is expected. A
built-in function is not okay, to prevent pickling something that
will execute os.system("rm -f *") when unpickling.
- dis.py will print the name of local variables referenced by local
load/store/delete instructions.
- Improved portability of SimpleHTTPServer module to non-Unix
platform.
- The thread.h interface adds an extra argument to down_sema(). This
only affects other C code that uses thread.c; the Python thread module
doesn't use semaphores (which aren't provided on all platforms where
Python threads are supported). Note: on NT, this change is not
implemented.
- Fixed some typos in abstract.h; corrected signature of
PyNumber_Coerce, added PyMapping_DelItem. Also fixed a bug in
abstract.c's PyObject_CallMethod().
- apply(classname, (), {}) now works even if the class has no
__init__() method.
- Implemented complex remainder and divmod() (these would dump core!).
Conversion of complex numbers to int, long int or float now raises an
exception, since there is no meaningful way to do it without losing
information.
- Fixed bug in built-in complex() function which gave the wrong result
for two real arguments.
- Change the hash algorithm for strings -- the multiplier is now
1000003 instead of 3, which gives better spread for short strings.
- New default path for Windows NT, the registry structure now supports
default paths for different install packages. (Mark Hammond -- the
next PythonWin release will use this.)
- Added more symbols to the python_nt.def file.
- When using GNU readline, set rl_readline_name to "python".
- The Ellipses built-in name has been renamed to Ellipsis -- this is
the correct singular form. Thanks to Ka-Ping Yee, who saved us from
eternal embarrassment.
- Bumped the PYTHON_API_VERSION to 1006, due to the Ellipses ->
Ellipsis name change.
- Updated the library reference manual. Added documentation of
restricted mode (rexec, Bastion) and the formatter module (for use
with the htmllib module). Fixed the documentation of htmllib
(finally).
- The reference manual is now maintained in FrameMaker.
- Upgraded scripts Doc/partparse.py and Doc/texi2html.py.
- Slight improvements to Doc/Makefile.
- Added fcntl.lockf(). This should be used for Unix file locking
instead of the posixfile module; lockf() is more portable.
- The getopt module now supports long option names, thanks to Lars
Wizenius.
- Plenty of changes to Tkinter and Canvas, mostly due to Fred Drake
and Nils Fischbeck.
- Use more bits of time.time() in whrandom's default seed().
- Performance hack for regex module's regs attribute.
- Don't close already closed socket in socket module.
- Correctly handle separators containing embedded nulls in
strop.split, strop.find and strop.rfind. Also added more detail to
error message for strop.atoi and friends.
- Moved fallback definition for hypot() to Python/hypot.c.
- Added fallback definition for strdup, in Python/strdup.c.
- Fixed some bugs where a function would return 0 to indicate an error
where it should return -1.
- Test for error returned by time.localtime(), and rationalized its MS
tests.
- Added Modules/Setup.local file, which is processed after Setup.
- Corrected bug in toplevel Makefile.in -- execution of regen script
would not use the right PATH and PYTHONPATH.
- Various and sundry NeXT configuration changes (sigh).
- Support systems where libreadline needs neither termcap nor curses.
- Improved ld_so_aix script and python.exp file (for AIX).
- More stringent test for working <stdarg.h> in configure script.
- Removed Demo/www subdirectory -- it was totally out of date.
- Improved demos and docs for Fred Drake's parser module; fixed one
typo in the module itself.
=========================================
==> Release 1.4beta3 (August 26 1996) <==
=========================================
(XXX This is less readable that it should. I promise to restructure
it for the final 1.4 release.)
What's new in 1.4beta3 (since beta2)?
-------------------------------------
- Name mangling to implement a simple form of class-private variables.
A name of the form "__spam" can't easily be used outside the class.
(This was added in 1.4beta3, but left out of the 1.4beta3 release
message.)
- In urllib.urlopen(): HTTP URLs containing user:passwd@host are now
handled correctly when using a proxy server.
- In ntpath.normpath(): don't truncate to 8+3 format.
- In mimetools.choose_boundary(): don't die when getuid() or getpid()
aren't defined.
- Module urllib: some optimizations to (un)quoting.
- New module MimeWriter for writing MIME documents.
- More changes to formatter module.
- The freeze script works once again and is much more robust (using
sys.prefix etc.). It also supports a -o option to specify an
output directory.
- New module whichdb recognizes dbm, gdbm and bsddb/dbhash files.
- The Doc/Makefile targets have been reorganized somewhat to remove the
insistence on always generating PostScript.
- The texinfo to html filter (Doc/texi2html.py) has been improved somewhat.
- "errors.h" has been renamed to "pyerrors.h" to resolve a long-standing
name conflict on the Mac.
- Linking a module compiled with a different setting for Py_TRACE_REFS now
generates a linker error rather than a core dump.
- The cgi module has a new convenience function print_exception(), which
formats a python exception using HTML. It also fixes a bug in the
compatibility code and adds a dubious feature which makes it possible to
have two query strings, one in the URL and one in the POST data.
- A subtle change in the unpickling of class instances makes it possible
to unpickle in restricted execution mode, where the __dict__ attribute is
not available (but setattr() is).
- Documentation for os.path.splitext() (== posixpath.splitext()) has been
cleared up. It splits at the *last* dot.
- posixfile locking is now also correctly supported on AIX.
- The tempfile module once again honors an initial setting of tmpdir. It
now works on Windows, too.
- The traceback module has some new functions to extract, format and print
the active stack.
- Some translation functions in the urllib module have been made a little
less sluggish.
- The addtag_* methods for Canvas widgets in Tkinter as well as in the
separate Canvas class have been fixed so they actually do something
meaningful.
- A tiny _test() function has been added to Tkinter.py.
- A generic Makefile for dynamically loaded modules is provided in the Misc
subdirectory (Misc/gMakefile).
- A new version of python-mode.el for Emacs is provided. See
http://www.python.org/ftp/emacs/pmdetails.html for details. The
separate file pyimenu.el is no longer needed, imenu support is folded
into python-mode.el.
- The configure script can finally correctly find the readline library in a
non-standard location. The LDFLAGS variable is passed on the Makefiles
from the configure script.
- Shared libraries are now installed as programs (i.e. with executable
permission). This is required on HP-UX and won't hurt on other systems.
- The objc.c module is no longer part of the distribution. Objective-C
support may become available as contributed software on the ftp site.
- The sybase module is no longer part of the distribution. A much
improved sybase module is available as contributed software from the
ftp site.
- _tkinter is now compatible with Tcl 7.5 / Tk 4.1 patch1 on Windows and
Mac (don't use unpatched Tcl/Tk!). The default line in the Setup.in file
now links with Tcl 7.5 / Tk 4.1 rather than 7.4/4.0.
- In Setup, you can now write "*shared*" instead of "*noconfig*", and you
can use *.so and *.sl as shared libraries.
- Some more fidgeting for AIX shared libraries.
- The mpz module is now compatible with GMP 2.x. (Not tested by me.)
(Note -- a complete replacement by Niels Mo"ller, called gpmodule, is
available from the contrib directory on the ftp site.)
- A warning is written to sys.stderr when a __del__ method raises an
exception (formerly, such exceptions were completely ignored).
- The configure script now defines HAVE_OLD_CPP if the C preprocessor is
incapable of ANSI style token concatenation and stringification.
- All source files (except a few platform specific modules) are once again
compatible with K&R C compilers as well as ANSI compilers. In particular,
ANSI-isms have been removed or made conditional in complexobject.c,
getargs.c and operator.c.
- The abstract object API has three new functions, PyObject_DelItem,
PySequence_DelItem, and PySequence_DelSlice.
- The operator module has new functions delitem and delslice, and the
functions "or" and "and" are renamed to "or_" and "and_" (since "or" and
"and" are reserved words). ("__or__" and "__and__" are unchanged.)
- The environment module is no longer supported; putenv() is now a function
in posixmodule (also under NT).
- Error in filter(<function>, "") has been fixed.
- Unrecognized keyword arguments raise TypeError, not KeyError.
- Better portability, fewer bugs and memory leaks, fewer compiler warnings,
some more documentation.
- Bug in float power boundary case (0.0 to the negative integer power)
fixed.
- The test of negative number to the float power has been moved from the
built-in pow() functin to floatobject.c (so complex numbers can yield the
correct result).
- The bug introduced in beta2 where shared libraries loaded (using
dlopen()) from the current directory would fail, has been fixed.
- Modules imported as shared libraries now also have a __file__ attribute,
giving the filename from which they were loaded. The only modules without
a __file__ attribute now are built-in modules.
- On the Mac, dynamically loaded modules can end in either ".slb" or
".<platform>.slb" where <platform> is either "CFM68K" or "ppc". The ".slb"
extension should only be used for "fat" binaries.
- C API addition: marshal.c now supports
PyMarshal_WriteObjectToString(object).
- C API addition: getargs.c now supports
PyArg_ParseTupleAndKeywords(args, kwdict, format, kwnames, ...)
to parse keyword arguments.
- The PC versioning scheme (sys.winver) has changed once again. the
version number is now "<digit>.<digit>.<digit>.<apiversion>", where the
first three <digit>s are the Python version (e.g. "1.4.0" for Python 1.4,
"1.4.1" for Python 1.4.1 -- the beta level is not included) and
<apiversion> is the four-digit PYTHON_API_VERSION (currently 1005).
- h2py.py accepts whitespace before the # in CPP directives
- On Solaris 2.5, it should now be possible to use either Posix threads or
Solaris threads (XXX: how do you select which is used???). (Note: the
Python pthreads interface doesn't fully support semaphores yet -- anyone
care to fix this?)
- Thread support should now work on AIX, using either DCE threads or
pthreads.
- New file Demo/sockets/unicast.py
- Working Mac port, with CFM68K support, with Tk 4.1 support (though not
both) (XXX)
- New project setup for PC port, now compatible with PythonWin, with
_tkinter and NumPy support (XXX)
- New module site.py (XXX)
- New module xdrlib.py and optional support module _xdrmodule.c (XXX)
- parser module adapted to new grammar, complete w/ Doc & Demo (XXX)
- regen script fixed (XXX)
- new machdep subdirectories Lib/{aix3,aix4,next3_3,freebsd2,linux2} (XXX)
- testall now also tests math module (XXX)
- string.atoi c.s. now raise an exception for an empty input string.
- At last, it is no longer necessary to define HAVE_CONFIG_H in order to
have config.h included at various places.
- Unrecognized keyword arguments now raise TypeError rather than KeyError.
- The makesetup script recognizes files with extension .so or .sl as
(shared) libraries.
- 'access' is no longer a reserved word, and all code related to its
implementation is gone (or at least #ifdef'ed out). This should make
Python a little speedier too!
- Performance enhancements suggested by Sjoerd Mullender. This includes
the introduction of two new optional function pointers in type object,
getattro and setattro, which are like getattr and setattr but take a
string object instead of a C string pointer.
- New operations in string module: lstrip(s) and rstrip(s) strip whitespace
only on the left or only on the right, A new optional third argument to
split() specifies the maximum number of separators honored (so
splitfields(s, sep, n) returns a list of at most n+1 elements). (Since
1.3, splitfields(s, None) is totally equivalent to split(s).)
string.capwords() has an optional second argument specifying the
separator (which is passed to split()).
- regsub.split() has the same addition as string.split(). regsub.splitx(s,
sep, maxsep) implements the functionality that was regsub.split(s, 1) in
1.4beta2 (return a list containing the delimiters as well as the words).
- Final touch for AIX loading, rewritten Misc/AIX-NOTES.
- In Modules/_tkinter.c, when using Tk 4.1 or higher, use className
argument to _tkinter.create() to set Tcl's argv0 variable, so X
resources use the right resource class again.
- Add #undef fabs to Modules/mathmodule.c for macintosh.
- Added some macro renames for AIX in Modules/operator.c.
- Removed spurious 'E' from Doc/liberrno.tex.
- Got rid of some cruft in Misc/ (dlMakefile, pyimenu.el); added new
Misc/gMakefile and new version of Misc/python-mode.el.
- Fixed typo in Lib/ntpath.py (islink has "return false" which gives a
NameError).
- Added missing "from types import *" to Lib/tkinter/Canvas.py.
- Added hint about using default args for __init__ to pickle docs.
- Corrected typo in Inclide/abstract.h: PySequence_Lenth ->
PySequence_Length.
- Some improvements to Doc/texi2html.py.
- In Python/import.c, Cast unsigned char * in struct _frozen to char *
in calls to rds_object().
- In doc/ref4.tex, added note about scope of lambda bodies.
What's new in 1.4beta2 (since beta1)?
-------------------------------------
- Portability bug in the md5.h header solved.
- The PC build procedure now really works, and sets sys.platform to a
meaningful value (a few things were botched in beta 1). Lib/dos_8x3
is now a standard part of the distribution (alas).
- More improvements to the installation procedure. Typing "make install"
now inserts the version number in the pathnames of almost everything
installed, and creates the machine dependent modules (FCNTL.py etc.) if not
supplied by the distribution. (XXX There's still a problem with the latter
because the "regen" script requires that Python is installed. Some manual
intervention may still be required.) (This has been fixed in 1.4beta3.)
- New modules: errno, operator (XXX).
- Changes for use with Numerical Python: builtin function slice() and
Ellipses object, and corresponding syntax:
x[lo:hi:stride] == x[slice(lo, hi, stride)]
x[a, ..., z] == x[(a, Ellipses, z)]
- New documentation for errno and cgi mdoules.
- The directory containing the script passed to the interpreter is
inserted in from of sys.path; "." is no longer a default path
component.
- Optional third string argument to string.translate() specifies
characters to delete. New function string.maketrans() creates a
translation table for translate() or for regex.compile().
- Module posix (and hence module os under Unix) now supports putenv().
Moreover, module os is enhanced so that if putenv() is supported,
assignments to os.environ entries make the appropriate putenv() call.
(XXX the putenv() implementation can leak a small amount of memory per
call.)
- pdb.py can now be invoked from the command line to debug a script:
python pdb.py <script> <arg> ...
- Much improved parseaddr() in rfc822.
- In cgi.py, you can now pass an alternative value for environ to
nearly all functions.
- You can now assign to instance variables whose name begins and ends
with '__'.
- New version of Fred Drake's parser module and associates (token,
symbol, AST).
- New PYTHON_API_VERSION value and .pyc file magic number (again!).
- The "complex" internal structure type is now called "Py_complex" to
avoid name conflicts.
- Numerous small bugs fixed.
- Slight pickle speedups.
- Some slight speedups suggested by Sjoerd (more coming in 1.4 final).
- NeXT portability mods by Bill Bumgarner integrated.
- Modules regexmodule.c, bsddbmodule.c and xxmodule.c have been
converted to new naming style.
What's new in 1.4beta1 (since 1.3)?
-----------------------------------
- Added sys.platform and sys.exec_platform for Bill Janssen.
- Installation has been completely overhauled. "make install" now installs
everything, not just the python binary. Installation uses the install-sh
script (borrowed from X11) to install each file.
- New functions in the posix module: mkfifo, plock, remove (== unlink),
and ftruncate. More functions are also available under NT.
- New function in the fcntl module: flock.
- Shared library support for FreeBSD.
- The --with-readline option can now be used without a DIRECTORY argument,
for systems where libreadline.* is in one of the standard places. It is
also possible for it to be a shared library.
- The extension tkinter has been renamed to _tkinter, to avoid confusion
with Tkinter.py oncase insensitive file systems. It now supports Tk 4.1 as
well as 4.0.
- Author's change of address from CWI in Amsterdam, The Netherlands, to
CNRI in Reston, VA, USA.
- The math.hypot() function is now always available (if it isn't found in
the C math library, Python provides its own implementation).
- The latex documentation is now compatible with latex2e, thanks to David
Ascher.
- The expression x**y is now equivalent to pow(x, y).
- The indexing expression x[a, b, c] is now equivalent to x[(a, b, c)].
- Complex numbers are now supported. Imaginary constants are written with
a 'j' or 'J' prefix, general complex numbers can be formed by adding a real
part to an imaginary part, like 3+4j. Complex numbers are always stored in
floating point form, so this is equivalent to 3.0+4.0j. It is also
possible to create complex numbers with the new built-in function
complex(re, [im]). For the footprint-conscious, complex number support can
be disabled by defining the symbol WITHOUT_COMPLEX.
- New built-in function list() is the long-awaited counterpart of tuple().
- There's a new "cmath" module which provides the same functions as the
"math" library but with complex arguments and results. (There are very
good reasons why math.sqrt(-1) still raises an exception -- you have to use
cmath.sqrt(-1) to get 1j for an answer.)
- The Python.h header file (which is really the same as allobjects.h except
it disables support for old style names) now includes several more files,
so you have to have fewer #include statements in the average extension.
- The NDEBUG symbol is no longer used. Code that used to be dependent on
the presence of NDEBUG is now present on the absence of DEBUG. TRACE_REFS
and REF_DEBUG have been renamed to Py_TRACE_REFS and Py_REF_DEBUG,
respectively. At long last, the source actually compiles and links without
errors when this symbol is defined.
- Several symbols that didn't follow the new naming scheme have been
renamed (usually by adding to rename2.h) to use a Py or _Py prefix. There
are no external symbols left without a Py or _Py prefix, not even those
defined by sources that were incorporated from elsewhere (regexpr.c,
md5c.c). (Macros are a different story...)
- There are now typedefs for the structures defined in config.c and
frozen.c.
- New PYTHON_API_VERSION value and .pyc file magic number.
- New module Bastion. (XXX)
- Improved performance of StringIO module.
- UserList module now supports + and * operators.
- The binhex and binascii modules now actually work.
- The cgi module has been almost totally rewritten and documented.
It now supports file upload and a new data type to handle forms more
flexibly.
- The formatter module (for use with htmllib) has been overhauled (again).
- The ftplib module now supports passive mode and has doc strings.
- In (ideally) all places where binary files are read or written, the file
is now correctly opened in binary mode ('rb' or 'wb') so the code will work
on Mac or PC.
- Dummy versions of os.path.expandvars() and expanduser() are now provided
on non-Unix platforms.
- Module urllib now has two new functions url2pathname and pathname2url
which turn local filenames into "file:..." URLs using the same rules as
Netscape (why be different). it also supports urlretrieve() with a
pathname parameter, and honors the proxy environment variables (http_proxy
etc.). The URL parsing has been improved somewhat, too.
- Micro improvements to urlparse. Added urlparse.urldefrag() which
removes a trailing ``#fragment'' if any.
- The mailbox module now supports MH style message delimiters as well.
- The mhlib module contains some new functionality: setcontext() to set the
current folder and parsesequence() to parse a sequence as commonly passed
to MH commands (e.g. 1-10 or last:5).
- New module mimify for conversion to and from MIME format of email
messages.
- Module ni now automatically installs itself when first imported -- this
is against the normal rule that modules should define classes and functions
but not invoke them, but appears more useful in the case that two
different, independent modules want to use ni's features.
- Some small performance enhancements in module pickle.
- Small interface change to the profile.run*() family of functions -- more
sensible handling of return values.
- The officially registered Mac creator for Python files is 'Pyth'. This
replaces 'PYTH' which was used before but never registered.
- Added regsub.capwords(). (XXX)
- Added string.capwords(), string.capitalize() and string.translate().
(XXX)
- Fixed an interface bug in the rexec module: it was impossible to pass a
hooks instance to the RExec class. rexec now also supports the dynamic
loading of modules from shared libraries. Some other interfaces have been
added too.
- Module rfc822 now caches the headers in a dictionary for more efficient
lookup.
- The sgmllib module now understands a limited number of SGML "shorthands"
like <A/.../ for <A>...</A>. (It's not clear that this was a good idea...)
- The tempfile module actually tries a number of different places to find a
usable temporary directory. (This was prompted by certain Linux
installations that appear to be missing a /usr/tmp directory.) [A bug in
the implementation that would ignore a pre-existing tmpdir global has been
fixed in beta3.]
- Much improved and enhanved FileDialog module for Tkinter.
- Many small changes to Tkinter, to bring it more in line with Tk 4.0 (as
well as Tk 4.1).
- New socket interfaces include ntohs(), ntohl(), htons(), htonl(), and
s.dup(). Sockets now work correctly on Windows. On Windows, the built-in
extension is called _socket and a wrapper module win/socket.py provides
"makefile()" and "dup()" functionality. On Windows, the select module
works only with socket objects.
- Bugs in bsddb module fixed (e.g. missing default argument values).
- The curses extension now includes <ncurses.h> when available.
- The gdbm module now supports opening databases in "fast" mode by
specifying 'f' as the second character or the mode string.
- new variables sys.prefix and sys.exec_prefix pass corresponding
configuration options / Makefile variables to the Python programmer.
- The ``new'' module now supports creating new user-defined classes as well
as instances thereof.
- The soundex module now sports get_soundex() to get the soundex value for an
arbitrary string (formerly it would only do soundex-based string
comparison) as well as doc strings.
- New object type "cobject" to safely wrap void pointers for passing them
between various extension modules.
- More efficient computation of float**smallint.
- The mysterious bug whereby "x.x" (two occurrences of the same
one-character name) typed from the commandline would sometimes fail
mysteriously.
- The initialization of the readline function can now be invoked by a C
extension through PyOS_ReadlineInit().
- There's now an externally visible pointer PyImport_FrozenModules which
can be changed by an embedding application.
- The argument parsing functions now support a new format character 'D' to
specify complex numbers.
- Various memory leaks plugged and bugs fixed.
- Improved support for posix threads (now that real implementations are
beginning to apepar). Still no fully functioning semaphores.
- Some various and sundry improvements and new entries in the Tools
directory.
=====================================
==> Release 1.3 (13 October 1995) <==
=====================================
Major change
============
Two words: Keyword Arguments. See the first section of Chapter 12 of
the Tutorial.
(The rest of this file is textually the same as the remaining sections
of that chapter.)
Changes to the WWW and Internet tools
=====================================
The "htmllib" module has been rewritten in an incompatible fashion.
The new version is considerably more complete (HTML 2.0 except forms,
but including all ISO-8859-1 entity definitions), and easy to use.
Small changes to "sgmllib" have also been made, to better match the
tokenization of HTML as recognized by other web tools.
A new module "formatter" has been added, for use with the new
"htmllib" module.
The "urllib"and "httplib" modules have been changed somewhat to allow
overriding unknown URL types and to support authentication. They now
use "mimetools.Message" instead of "rfc822.Message" to parse headers.
The "endrequest()" method has been removed from the HTTP class since
it breaks the interaction with some servers.
The "rfc822.Message" class has been changed to allow a flag to be
passed in that says that the file is unseekable.
The "ftplib" module has been fixed to be (hopefully) more robust on
Linux.
Several new operations that are optionally supported by servers have
been added to "nntplib": "xover", "xgtitle", "xpath" and "date".
Other Language Changes
======================
The "raise" statement now takes an optional argument which specifies
the traceback to be used when printing the exception's stack trace.
This must be a traceback object, such as found in "sys.exc_traceback".
When omitted or given as "None", the old behavior (to generate a stack
trace entry for the current stack frame) is used.
The tokenizer is now more tolerant of alien whitespace. Control-L in
the leading whitespace of a line resets the column number to zero,
while Control-R just before the end of the line is ignored.
Changes to Built-in Operations
==============================
For file objects, "f.read(0)" and "f.readline(0)" now return an empty
string rather than reading an unlimited number of bytes. For the
latter, omit the argument altogether or pass a negative value.
A new system variable, "sys.platform", has been added. It specifies
the current platform, e.g. "sunos5" or "linux1".
The built-in functions "input()" and "raw_input()" now use the GNU
readline library when it has been configured (formerly, only
interactive input to the interpreter itself was read using GNU
readline). The GNU readline library provides elaborate line editing
and history. The Python debugger ("pdb") is the first beneficiary of
this change.
Two new built-in functions, "globals()" and "locals()", provide access
to dictionaries containming current global and local variables,
respectively. (These augment rather than replace "vars()", which
returns the current local variables when called without an argument,
and a module's global variables when called with an argument of type
module.)
The built-in function "compile()" now takes a third possible value for
the kind of code to be compiled: specifying "'single'" generates code
for a single interactive statement, which prints the output of
expression statements that evaluate to something else than "None".
Library Changes
===============
There are new module "ni" and "ihooks" that support importing modules
with hierarchical names such as "A.B.C". This is enabled by writing
"import ni; ni.ni()" at the very top of the main program. These
modules are amply documented in the Python source.
The module "rexec" has been rewritten (incompatibly) to define a class
and to use "ihooks".
The "string.split()" and "string.splitfields()" functions are now the
same function (the presence or absence of the second argument
determines which operation is invoked); similar for "string.join()"
and "string.joinfields()".
The "Tkinter" module and its helper "Dialog" have been revamped to use
keyword arguments. Tk 4.0 is now the standard. A new module
"FileDialog" has been added which implements standard file selection
dialogs.
The optional built-in modules "dbm" and "gdbm" are more coordinated
--- their "open()" functions now take the same values for their "flag"
argument, and the "flag" and "mode" argument have default values (to
open the database for reading only, and to create the database with
mode "0666" minuse the umask, respectively). The memory leaks have
finally been fixed.
A new dbm-like module, "bsddb", has been added, which uses the BSD DB
package's hash method.
A portable (though slow) dbm-clone, implemented in Python, has been
added for systems where none of the above is provided. It is aptly
dubbed "dumbdbm".
The module "anydbm" provides a unified interface to "bsddb", "gdbm",
"dbm", and "dumbdbm", choosing the first one available.
A new extension module, "binascii", provides a variety of operations
for conversion of text-encoded binary data.
There are three new or rewritten companion modules implemented in
Python that can encode and decode the most common such formats: "uu"
(uuencode), "base64" and "binhex".
A module to handle the MIME encoding quoted-printable has also been
added: "quopri".
The parser module (which provides an interface to the Python parser's
abstract syntax trees) has been rewritten (incompatibly) by Fred
Drake. It now lets you change the parse tree and compile the result!
The \code{syslog} module has been upgraded and documented.
Other Changes
=============
The dynamic module loader recognizes the fact that different filenames
point to the same shared library and loads the library only once, so
you can have a single shared library that defines multiple modules.
(SunOS / SVR4 style shared libraries only.)
Jim Fulton's ``abstract object interface'' has been incorporated into
the run-time API. For more detailes, read the files
"Include/abstract.h" and "Objects/abstract.c".
The Macintosh version is much more robust now.
Numerous things I have forgotten or that are so obscure no-one will
notice them anyway :-)
===================================
==> Release 1.2 (13 April 1995) <==
===================================
- Changes to Misc/python-mode.el:
- Wrapping and indentation within triple quote strings should work
properly now.
- `Standard' bug reporting mechanism (use C-c C-b)
- py-mark-block was moved to C-c C-m
- C-c C-v shows you the python-mode version
- a basic python-font-lock-keywords has been added for Emacs 19
font-lock colorizations.
- proper interaction with pending-del and del-sel modes.
- New py-electric-colon (:) command for improved outdenting. Also
py-indent-line (TAB) should handle outdented lines better.
- New commands py-outdent-left (C-c C-l) and py-indent-right (C-c C-r)
- The Library Reference has been restructured, and many new and
existing modules are now documented, in particular the debugger and
the profiler, as well as the persistency and the WWW/Internet support
modules.
- All known bugs have been fixed. For example the pow(2,2,3L) bug on
Linux has been fixed. Also the re-entrancy problems with __del__ have
been fixed.
- All known memory leaks have been fixed.
- Phase 2 of the Great Renaming has been executed. The header files
now use the new names (PyObject instead of object, etc.). The linker
also sees the new names. Most source files still use the old names,
by virtue of the rename2.h header file. If you include Python.h, you
only see the new names. Dynamically linked modules have to be
recompiled. (Phase 3, fixing the rest of the sources, will be
executed gradually with the release later versions.)
- The hooks for implementing "safe-python" (better called "restricted
execution") are in place. Specifically, the import statement is
implemented by calling the built-in function __import__, and the
built-in names used in a particular scope are taken from the
dictionary __builtins__ in that scope's global dictionary. See also
the new (unsupported, undocumented) module rexec.py.
- The import statement now supports the syntax "import a.b.c" and
"from a.b.c import name". No officially supported implementation
exists, but one can be prototyped by replacing the built-in __import__
function. A proposal by Ken Manheimer is provided as newimp.py.
- All machinery used by the import statement (or the built-in
__import__ function) is now exposed through the new built-in module
"imp" (see the library reference manual). All dynamic loading
machinery is moved to the new file importdl.c.
- Persistent storage is supported through the use of the modules
"pickle" and "shelve" (implemented in Python). There's also a "copy"
module implementing deepcopy and normal (shallow) copy operations.
See the library reference manual.
- Documentation strings for many objects types are accessible through
the __doc__ attribute. Modules, classes and functions support special
syntax to initialize the __doc__ attribute: if the first statement
consists of just a string literal, that string literal becomes the
value of the __doc__ attribute. The default __doc__ attribute is
None. Documentation strings are also supported for built-in
functions, types and modules; however this feature hasn't been widely
used yet. See the 'new' module for an example. (Basically, the type
object's tp_doc field contains the doc string for the type, and the
4th member of the methodlist structure contains the doc string for the
method.)
- The __coerce__ and __cmp__ methods for user-defined classes once
again work as expected. As an example, there's a new standard class
Complex in the library.
- The functions posix.popen() and posix.fdopen() now have an optional
third argument to specify the buffer size, and default their second
(mode) argument to 'r' -- in analogy to the builtin open() function.
The same applies to posixfile.open() and the socket method makefile().
- The thread.exit_thread() function now raises SystemExit so that
'finally' clauses are honored and a memory leak is plugged.
- Improved X11 and Motif support, by Sjoerd Mullender. This extension
is being maintained and distributed separately.
- Improved support for the Apple Macintosh, in part by Jack Jansen,
e.g. interfaces to (a few) resource mananger functions, get/set file
type and creator, gestalt, sound manager, speech manager, MacTCP, comm
toolbox, and the think C console library. This is being maintained
and distributed separately.
- Improved version for Windows NT, by Mark Hammond. This is being
maintained and distributed separately.
- Used autoconf 2.0 to generate the configure script. Adapted
configure.in to use the new features in autoconf 2.0.
- It now builds on the NeXT without intervention, even on the 3.3
Sparc pre-release.
- Characters passed to isspace() and friends are masked to nonnegative
values.
- Correctly compute pow(-3.0, 3).
- Fix portability problems with getopt (configure now checks for a
non-GNU getopt).
- Don't add frozenmain.o to libPython.a.
- Exceptions can now be classes. ALl built-in exceptions are still
string objects, but this will change in the future.
- The socket module exports a long list of socket related symbols.
(More built-in modules will export their symbolic constants instead of
relying on a separately generated Python module.)
- When a module object is deleted, it clears out its own dictionary.
This fixes a circularity in the references between functions and
their global dictionary.
- Changed the error handling by [new]getargs() e.g. for "O&".
- Dynamic loading of modules using shared libraries is supported for
several new platforms.
- Support "O&", "[...]" and "{...}" in mkvalue().
- Extension to findmethod(): findmethodinchain() (where a chain is a
linked list of methodlist arrays). The calling interface for
findmethod() has changed: it now gets a pointer to the (static!)
methodlist structure rather than just to the function name -- this
saves copying flags etc. into the (short-lived) method object.
- The callable() function is now public.
- Object types can define a few new operations by setting function
pointers in the type object structure: tp_call defines how an object
is called, and tp_str defines how an object's str() is computed.
===================================
==> Release 1.1.1 (10 Nov 1994) <==
===================================
This is a pure bugfix release again. See the ChangeLog file for details.
One exception: a few new features were added to tkinter.
=================================
==> Release 1.1 (11 Oct 1994) <==
=================================
This release adds several new features, improved configuration and
portability, and fixes more bugs than I can list here (including some
memory leaks).
The source compiles and runs out of the box on more platforms than
ever -- including Windows NT. Makefiles or projects for a variety of
non-UNIX platforms are provided.
APOLOGY: some new features are badly documented or not at all. I had
the choice -- postpone the new release indefinitely, or release it
now, with working code but some undocumented areas. The problem with
postponing the release is that people continue to suffer from existing
bugs, and send me patches based on the previous release -- which I
can't apply directly because my own source has changed. Also, some
new modules (like signal) have been ready for release for quite some
time, and people are anxiously waiting for them. In the case of
signal, the interface is simple enough to figure out without
documentation (if you're anxious enough :-). In this case it was not
simple to release the module on its own, since it relies on many small
patches elsewhere in the source.
For most new Python modules, the source code contains comments that
explain how to use them. Documentation for the Tk interface, written
by Matt Conway, is available as tkinter-doc.tar.gz from the Python
home and mirror ftp sites (see Misc/FAQ for ftp addresses). For the
new operator overloading facilities, have a look at Demo/classes:
Complex.py and Rat.py show how to implement a numeric type without and
with __coerce__ method. Also have a look at the end of the Tutorial
document (Doc/tut.tex). If you're still confused: use the newsgroup
or mailing list.
New language features:
- More flexible operator overloading for user-defined classes
(INCOMPATIBLE WITH PREVIOUS VERSIONS!) See end of tutorial.
- Classes can define methods named __getattr__, __setattr__ and
__delattr__ to trap attribute accesses. See end of tutorial.
- Classes can define method __call__ so instances can be called
directly. See end of tutorial.
New support facilities:
- The Makefiles (for the base interpreter as well as for extensions)
now support creating dynamically loadable modules if the platform
supports shared libraries.
- Passing the interpreter a .pyc file as script argument will execute
the code in that file. (On the Mac such files can be double-clicked!)
- New Freeze script, to create independently distributable "binaries"
of Python programs -- look in Demo/freeze
- Improved h2py script (in Demo/scripts) follows #includes and
supports macros with one argument
- New module compileall generates .pyc files for all modules in a
directory (tree) without also executing them
- Threads should work on more platforms
New built-in modules:
- tkinter (support for Tcl's Tk widget set) is now part of the base
distribution
- signal allows catching or ignoring UNIX signals (unfortunately still
undocumented -- any taker?)
- termios provides portable access to POSIX tty settings
- curses provides an interface to the System V curses library
- syslog provides an interface to the (BSD?) syslog daemon
- 'new' provides interfaces to create new built-in object types
(e.g. modules and functions)
- sybase provides an interface to SYBASE database
New/obsolete built-in methods:
- callable(x) tests whether x can be called
- sockets now have a setblocking() method
- sockets no longer have an allowbroadcast() method
- socket methods send() and sendto() return byte count
New standard library modules:
- types.py defines standard names for built-in types, e.g. StringType
- urlparse.py parses URLs according to the latest Internet draft
- uu.py does uuencode/uudecode (not the fastest in the world, but
quicker than installing uuencode on a non-UNIX machine :-)
- New, faster and more powerful profile module.py
- mhlib.py provides interface to MH folders and messages
New facilities for extension writers (unfortunately still
undocumented):
- newgetargs() supports optional arguments and improved error messages
- O!, O& O? formats for getargs allow more versatile type checking of
non-standard types
- can register pending asynchronous callback, to be called the next
time the Python VM begins a new instruction (Py_AddPendingCall)
- can register cleanup routines to be called when Python exits
(Py_AtExit)
- makesetup script understands C++ files in Setup file (use file.C
or file.cc)
- Make variable OPT is passed on to sub-Makefiles
- An init<module>() routine may signal an error by not entering
the module in the module table and raising an exception instead
- For long module names, instead of foobarbletchmodule.c you can
use foobarbletch.c
- getintvalue() and getfloatvalue() try to convert any object
instead of requiring an "intobject" or "floatobject"
- All the [new]getargs() formats that retrieve an integer value
will now also work if a float is passed
- C function listtuple() converts list to tuple, fast
- You should now call sigcheck() instead of intrcheck();
sigcheck() also sets an exception when it returns nonzero
====================================
==> Release 1.0.3 (14 July 1994) <==
====================================
This release consists entirely of bug fixes to the C sources; see the
head of ../ChangeLog for a complete list. Most important bugs fixed:
- Sometimes the format operator (string%expr) would drop the last
character of the format string
- Tokenizer looped when last line did not end in \n
- Bug when triple-quoted string ended in quote plus newline
- Typo in socketmodule (listen) (== instead of =)
- typing vars() at the >>> prompt would cause recursive output
==================================
==> Release 1.0.2 (4 May 1994) <==
==================================
Overview of the most visible changes. Bug fixes are not listed. See
also ChangeLog.
Tokens
------
* String literals follow Standard C rules: they may be continued on
the next line using a backslash; adjacent literals are concatenated
at compile time.
* A new kind of string literals, surrounded by triple quotes (""" or
'''), can be continued on the next line without a backslash.
Syntax
------
* Function arguments may have a default value, e.g. def f(a, b=1);
defaults are evaluated at function definition time. This also applies
to lambda.
* The try-except statement has an optional else clause, which is
executed when no exception occurs in the try clause.
Interpreter
-----------
* The result of a statement-level expression is no longer printed,
except_ for expressions entered interactively. Consequently, the -k
command line option is gone.
* The result of the last printed interactive expression is assigned to
the variable '_'.
* Access to implicit global variables has been speeded up by removing
an always-failing dictionary lookup in the dictionary of local
variables (mod suggested by Steve Makewski and Tim Peters).
* There is a new command line option, -u, to force stdout and stderr
to be unbuffered.
* Incorporated Steve Majewski's mods to import.c for dynamic loading
under AIX.
* Fewer chances of dumping core when trying to reload or re-import
static built-in, dynamically loaded built-in, or frozen modules.
* Loops over sequences now don't ask for the sequence's length when
they start, but try to access items 0, 1, 2, and so on until they hit
an IndexError. This makes it possible to create classes that generate
infinite or indefinite sequences a la Steve Majewski. This affects
for loops, the (not) in operator, and the built-in functions filter(),
map(), max(), min(), reduce().
Changed Built-in operations
---------------------------
* The '%' operator on strings (printf-style formatting) supports a new
feature (adapted from a patch by Donald Beaudry) to allow
'%(<key>)<format>' % {...} to take values from a dictionary by name
instead of from a tuple by position (see also the new function
vars()).
* The '%s' formatting operator is changed to accept any type and
convert it to a string using str().
* Dictionaries with more than 20,000 entries can now be created
(thanks to Steve Kirsch).
New Built-in Functions
----------------------
* vars() returns a dictionary containing the local variables; vars(m)
returns a dictionary containing the variables of module m. Note:
dir(x) is now equivalent to vars(x).keys().
Changed Built-in Functions
--------------------------
* open() has an optional third argument to specify the buffer size: 0
for unbuffered, 1 for line buffered, >1 for explicit buffer size, <0
for default.
* open()'s second argument is now optional; it defaults to "r".
* apply() now checks that its second argument is indeed a tuple.
New Built-in Modules
--------------------
Changed Built-in Modules
------------------------
The thread module no longer supports exit_prog().
New Python Modules
------------------
* Module addpack contains a standard interface to modify sys.path to
find optional packages (groups of related modules).
* Module urllib contains a number of functions to access
World-Wide-Web files specified by their URL.
* Module httplib implements the client side of the HTTP protocol used
by World-Wide-Web servers.
* Module gopherlib implements the client side of the Gopher protocol.
* Module mailbox (by Jack Jansen) contains a parser for UNIX and MMDF
style mailbox files.
* Module random contains various random distributions, e.g. gauss().
* Module lockfile locks and unlocks open files using fcntl (inspired
by a similar module by Andy Bensky).
* Module ntpath (by Jaap Vermeulen) implements path operations for
Windows/NT.
* Module test_thread (in Lib/test) contains a small test set for the
thread module.
Changed Python Modules
----------------------
* The string module's expandvars() function is now documented and is
implemented in Python (using regular expressions) instead of forking
off a shell process.
* Module rfc822 now supports accessing the header fields using the
mapping/dictionary interface, e.g. h['subject'].
* Module pdb now makes it possible to set a break on a function
(syntax: break <expression>, where <expression> yields a function
object).
Changed Demos
-------------
* The Demo/scripts/freeze.py script is working again (thanks to Jaap
Vermeulen).
New Demos
---------
* Demo/threads/Generator.py is a proposed interface for restartable
functions a la Tim Peters.
* Demo/scripts/newslist.py, by Quentin Stafford-Fraser, generates a
directory full of HTML pages which between them contain links to all
the newsgroups available on your server.
* Demo/dns contains a DNS (Domain Name Server) client.
* Demo/lutz contains miscellaneous demos by Mark Lutz (e.g. psh.py, a
nice enhanced Python shell!!!).
* Demo/turing contains a Turing machine by Amrit Prem.
Documentation
-------------
* Documented new language features mentioned above (but not all new
modules).
* Added a chapter to the Tutorial describing recent additions to
Python.
* Clarified some sentences in the reference manual,
e.g. break/continue, local/global scope, slice assignment.
Source Structure
----------------
* Moved Include/tokenizer.h to Parser/tokenizer.h.
* Added Python/getopt.c for systems that don't have it.
Emacs mode
----------
* Indentation of continuated lines is done more intelligently;
consequently the variable py-continuation-offset is gone.
========================================
==> Release 1.0.1 (15 February 1994) <==
========================================
* Many portability fixes should make it painless to build Python on
several new platforms, e.g. NeXT, SEQUENT, WATCOM, DOS, and Windows.
* Fixed test for <stdarg.h> -- this broke on some platforms.
* Fixed test for shared library dynalic loading -- this broke on SunOS
4.x using the GNU loader.
* Changed order and number of SVR4 networking libraries (it is now
-lsocket -linet -lnsl, if these libraries exist).
* Installing the build intermediate stages with "make libainstall" now
also installs config.c.in, Setup and makesetup, which are used by the
new Extensions mechanism.
* Improved README file contains more hints and new troubleshooting
section.
* The built-in module strop now defines fast versions of three more
functions of the standard string module: atoi(), atol() and atof().
The strop versions of atoi() and atol() support an optional second
argument to specify the base (default 10). NOTE: you don't have to
explicitly import strop to use the faster versions -- the string
module contains code to let versions from stop override the default
versions.
* There is now a working Lib/dospath.py for those who use Python under
DOS (or Windows). Thanks, Jaap!
* There is now a working Modules/dosmodule.c for DOS (or Windows)
system calls.
* Lib.os.py has been reorganized (making it ready for more operating
systems).
* Lib/ospath.py is now obsolete (use os.path instead).
* Many fixes to the tutorial to make it match Python 1.0. Thanks,
Tim!
* Fixed Doc/Makefile, Doc/README and various scripts there.
* Added missing description of fdopen to Doc/libposix.tex.
* Made cleanup() global, for the benefit of embedded applications.
* Added parsing of addresses and dates to Lib/rfc822.py.
* Small fixes to Lib/aifc.py, Lib/sunau.py, Lib/tzparse.py to make
them usable at all.
* New module Lib/wave.py reads RIFF (*.wav) audio files.
* Module Lib/filewin.py moved to Lib/stdwin/filewin.py where it
belongs.
* New options and comments for Modules/makesetup (used by new
Extension mechanism).
* Misc/HYPE contains text of announcement of 1.0.0 in comp.lang.misc
and elsewhere.
* Fixed coredump in filter(None, 'abcdefg').
=======================================
==> Release 1.0.0 (26 January 1994) <==
=======================================
As is traditional, so many things have changed that I can't pretend to
be complete in these release notes, but I'll try anyway :-)
Note that the very last section is labeled "remaining bugs".
Source organization and build process
-------------------------------------
* The sources have finally been split: instead of a single src
subdirectory there are now separate directories Include, Parser,
Grammar, Objects, Python and Modules. Other directories also start
with a capital letter: Misc, Doc, Lib, Demo.
* A few extensions (notably Amoeba and X support) have been moved to a
separate subtree Extensions, which is no longer in the core
distribution, but separately ftp'able as extensions.tar.Z. (The
distribution contains a placeholder Ext-dummy with a description of
the Extensions subtree as well as the most recent versions of the
scripts used there.)
* A few large specialized demos (SGI video and www) have been
moved to a separate subdirectory Demo2, which is no longer in the core
distribution, but separately ftp'able as demo2.tar.Z.
* Parts of the standard library have been moved to subdirectories:
there are now standard subdirectories stdwin, test, sgi and sun4.
* The configuration process has radically changed: I now use GNU
autoconf. This makes it much easier to build on new Unix flavors, as
well as fully supporting VPATH (if your Make has it). The scripts
Configure.py and Addmodule.sh are no longer needed. Many source files
have been adapted in order to work with the symbols that the configure
script generated by autoconf defines (or not); the resulting source is
much more portable to different C compilers and operating systems,
even non Unix systems (a Mac port was done in an afternoon). See the
toplevel README file for a description of the new build process.
* GNU readline (a slightly newer version) is now a subdirectory of the
Python toplevel. It is still not automatically configured (being
totally autoconf-unaware :-). One problem has been solved: typing
Control-C to a readline prompt will now work. The distribution no
longer contains a "super-level" directory (above the python toplevel
directory), and dl, dl-dld and GNU dld are no longer part of the
Python distribution (you can still ftp them from
ftp.cwi.nl:/pub/dynload).
* The DOS functions have been taken out of posixmodule.c and moved
into a separate file dosmodule.c.
* There's now a separate file version.c which contains nothing but
the version number.
* The actual main program is now contained in config.c (unless NO_MAIN
is defined); pythonmain.c now contains a function realmain() which is
called from config.c's main().
* All files needed to use the built-in module md5 are now contained in
the distribution. The module has been cleaned up considerably.
Documentation
-------------
* The library manual has been split into many more small latex files,
so it is easier to edit Doc/lib.tex file to create a custom library
manual, describing only those modules supported on your system. (This
is not automated though.)
* A fourth manual has been added, titled "Extending and Embedding the
Python Interpreter" (Doc/ext.tex), which collects information about
the interpreter which was previously spread over several files in the
misc subdirectory.
* The entire documentation is now also available on-line for those who
have a WWW browser (e.g. NCSA Mosaic). Point your browser to the URL
"http://www.cwi.nl/~guido/Python.html".
Syntax
------
* Strings may now be enclosed in double quotes as well as in single
quotes. There is no difference in interpretation. The repr() of
string objects will use double quotes if the string contains a single
quote and no double quotes. Thanks to Amrit Prem for these changes!
* There is a new keyword 'exec'. This replaces the exec() built-in
function. If a function contains an exec statement, local variable
optimization is not performed for that particular function, thus
making assignment to local variables in exec statements less
confusing. (As a consequence, os.exec and python.exec have been
renamed to execv.)
* There is a new keyword 'lambda'. An expression of the form
lambda <parameters> : <expression>
yields an anonymous function. This is really only syntactic sugar;
you can just as well define a local function using
def some_temporary_name(<parameters>): return <expression>
Lambda expressions are particularly useful in combination with map(),
filter() and reduce(), described below. Thanks to Amrit Prem for
submitting this code (as well as map(), filter(), reduce() and
xrange())!
Built-in functions
------------------
* The built-in module containing the built-in functions is called
__builtin__ instead of builtin.
* New built-in functions map(), filter() and reduce() perform standard
functional programming operations (though not lazily):
- map(f, seq) returns a new sequence whose items are the items from
seq with f() applied to them.
- filter(f, seq) returns a subsequence of seq consisting of those
items for which f() is true.
- reduce(f, seq, initial) returns a value computed as follows:
acc = initial
for item in seq: acc = f(acc, item)
return acc
* New function xrange() creates a "range object". Its arguments are
the same as those of range(), and when used in a for loop a range
objects also behaves identical. The advantage of xrange() over
range() is that its representation (if the range contains many
elements) is much more compact than that of range(). The disadvantage
is that the result cannot be used to initialize a list object or for
the "Python idiom" [RED, GREEN, BLUE] = range(3). On some modern
architectures, benchmarks have shown that "for i in range(...): ..."
actually executes *faster* than "for i in xrange(...): ...", but on
memory starved machines like PCs running DOS range(100000) may be just
too big to be represented at all...
* Built-in function exec() has been replaced by the exec statement --
see above.
The interpreter
---------------
* Syntax errors are now not printed to stderr by the parser, but
rather the offending line and other relevant information are packed up
in the SyntaxError exception argument. When the main loop catches a
SyntaxError exception it will print the error in the same format as
previously, but at the proper position in the stack traceback.
* You can now set a maximum to the number of traceback entries
printed by assigning to sys.tracebacklimit. The default is 1000.
* The version number in .pyc files has changed yet again.
* It is now possible to have a .pyc file without a corresponding .py
file. (Warning: this may break existing installations if you have an
old .pyc file lingering around somewhere on your module search path
without a corresponding .py file, when there is a .py file for a
module of the same name further down the path -- the new interpreter
will find the first .pyc file and complain about it, while the old
interpreter would ignore it and use the .py file further down.)
* The list sys.builtin_module_names is now sorted and also contains
the names of a few hardwired built-in modules (sys, __main__ and
__builtin__).
* A module can now find its own name by accessing the global variable
__name__. Assigning to this variable essentially renames the module
(it should also be stored under a different key in sys.modules).
A neat hack follows from this: a module that wants to execute a main
program when called as a script no longer needs to compare
sys.argv[0]; it can simply do "if __name__ == '__main__': main()".
* When an object is printed by the print statement, its implementation
of str() is used. This means that classes can define __str__(self) to
direct how their instances are printed. This is different from
__repr__(self), which should define an unambigous string
representation of the instance. (If __str__() is not defined, it
defaults to __repr__().)
* Functions and code objects can now be compared meaningfully.
* On systems supporting SunOS or SVR4 style shared libraries, dynamic
loading of modules using shared libraries is automatically configured.
Thanks to Bill Jansen and Denis Severson for contributing this change!
Built-in objects
----------------
* File objects have acquired a new method writelines() which is the
reverse of readlines(). (It does not actually write lines, just a
list of strings, but the symmetry makes the choice of name OK.)
Built-in modules
----------------
* Socket objects no longer support the avail() method. Use the select
module instead, or use this function to replace it:
def avail(f):
import select
return f in select.select([f], [], [], 0)[0]
* Initialization of stdwin is done differently. It actually modifies
sys.argv (taking out the options the X version of stdwin recognizes)
the first time it is imported.
* A new built-in module parser provides a rudimentary interface to the
python parser. Corresponding standard library modules token and symbol
defines the numeric values of tokens and non-terminal symbols.
* The posix module has aquired new functions setuid(), setgid(),
execve(), and exec() has been renamed to execv().
* The array module is extended with 8-byte object swaps, the 'i'
format character, and a reverse() method. The read() and write()
methods are renamed to fromfile() and tofile().
* The rotor module has freed of portability bugs. This introduces a
backward compatibility problem: strings encoded with the old rotor
module can't be decoded by the new version.
* For select.select(), a timeout (4th) argument of None means the same
as leaving the timeout argument out.
* Module strop (and hence standard library module string) has aquired
a new function: rindex(). Thanks to Amrit Prem!
* Module regex defines a new function symcomp() which uses an extended
regular expression syntax: parenthesized subexpressions may be labeled
using the form "\(<labelname>...\)", and the group() method can return
sub-expressions by name. Thanks to Tracy Tims for these changes!
* Multiple threads are now supported on Solaris 2. Thanks to Sjoerd
Mullender!
Standard library modules
------------------------
* The library is now split in several subdirectories: all stuff using
stdwin is in Lib/stdwin, all SGI specific (or SGI Indigo or GL) stuff
is in Lib/sgi, all Sun Sparc specific stuff is in Lib/sun4, and all
test modules are in Lib/test. The default module search path will
include all relevant subdirectories by default.
* Module os now knows about trying to import dos. It defines
functions execl(), execle(), execlp() and execvp().
* New module dospath (should be attacked by a DOS hacker though).
* All modules defining classes now define __init__() constructors
instead of init() methods. THIS IS AN INCOMPATIBLE CHANGE!
* Some minor changes and bugfixes module ftplib (mostly Steve
Majewski's suggestions); the debug() method is renamed to
set_debuglevel().
* Some new test modules (not run automatically by testall though):
test_audioop, test_md5, test_rgbimg, test_select.
* Module string now defines rindex() and rfind() in analogy of index()
and find(). It also defines atof() and atol() (and corresponding
exceptions) in analogy to atoi().
* Added help() functions to modules profile and pdb.
* The wdb debugger (now in Lib/stdwin) now shows class or instance
variables on a double click. Thanks to Sjoerd Mullender!
* The (undocumented) module lambda has gone -- you couldn't import it
any more, and it was basically more a demo than a library module...
Multimedia extensions
---------------------
* The optional built-in modules audioop and imageop are now standard
parts of the interpreter. Thanks to Sjoerd Mullender and Jack Jansen
for contributing this code!
* There's a new operation in audioop: minmax().
* There's a new built-in module called rgbimg which supports portable
efficient reading of SGI RCG image files. Thanks also to Paul
Haeberli for the original code! (Who will contribute a GIF reader?)
* The module aifc is gone -- you should now always use aifc, which has
received a facelift.
* There's a new module sunau., for reading Sun (and NeXT) audio files.
* There's a new module audiodev which provides a uniform interface to
(SGI Indigo and Sun Sparc) audio hardware.
* There's a new module sndhdr which recognizes various sound files by
looking in their header and checking for various magic words.
Optimizations
-------------
* Most optimizations below can be configured by compile-time flags.
Thanks to Sjoerd Mullender for submitting these optimizations!
* Small integers (default -1..99) are shared -- i.e. if two different
functions compute the same value it is possible (but not
guaranteed!!!) that they return the same *object*. Python programs
can detect this but should *never* rely on it.
* Empty tuples (which all compare equal) are shared in the same
manner.
* Tuples of size up to 20 (default) are put in separate free lists
when deallocated.
* There is a compile-time option to cache a string's hash function,
but this appeared to have a negligeable effect, and as it costs 4
bytes per string it is disabled by default.
Embedding Python
----------------
* The initialization interface has been simplified somewhat. You now
only call "initall()" to initialize the interpreter.
* The previously announced renaming of externally visible identifiers
has not been carried out. It will happen in a later release. Sorry.
Miscellaneous bugs that have been fixed
---------------------------------------
* All known portability bugs.
* Version 0.9.9 dumped core in <listobject>.sort() which has been
fixed. Thanks to Jaap Vermeulen for fixing this and posting the fix
on the mailing list while I was away!
* Core dump on a format string ending in '%', e.g. in the expression
'%' % None.
* The array module yielded a bogus result for concatenation (a+b would
yield a+a).
* Some serious memory leaks in strop.split() and strop.splitfields().
* Several problems with the nis module.
* Subtle problem when copying a class method from another class
through assignment (the method could not be called).
Remaining bugs
--------------
* One problem with 64-bit machines remains -- since .pyc files are
portable and use only 4 bytes to represent an integer object, 64-bit
integer literals are silently truncated when written into a .pyc file.
Work-around: use eval('123456789101112').
* The freeze script doesn't work any more. A new and more portable
one can probably be cooked up using tricks from Extensions/mkext.py.
* The dos support hasn't been tested yet. (Really Soon Now we should
have a PC with a working C compiler!)
===================================
==> Release 0.9.9 (29 Jul 1993) <==
===================================
I *believe* these are the main user-visible changes in this release,
but there may be others. SGI users may scan the {src,lib}/ChangeLog
files for improvements of some SGI specific modules, e.g. aifc and
cl. Developers of extension modules should also read src/ChangeLog.
Naming of C symbols used by the Python interpreter
--------------------------------------------------
* This is the last release using the current naming conventions. New
naming conventions are explained in the file misc/NAMING.
Summarizing, all externally visible symbols get (at least) a "Py"
prefix, and most functions are renamed to the standard form
PyModule_FunctionName.
* Writers of extensions are urged to start using the new naming
conventions. The next release will use the new naming conventions
throughout (it will also have a different source directory
structure).
* As a result of the preliminary work for the great renaming, many
functions that were accidentally global have been made static.
BETA X11 support
----------------
* There are now modules interfacing to the X11 Toolkit Intrinsics, the
Athena widgets, and the Motif 1.1 widget set. These are not yet
documented except through the examples and README file in the demo/x11
directory. It is expected that this interface will be replaced by a
more powerful and correct one in the future, which may or may not be
backward compatible. In other words, this part of the code is at most
BETA level software! (Note: the rest of Python is rock solid as ever!)
* I understand that the above may be a bit of a disappointment,
however my current schedule does not allow me to change this situation
before putting the release out of the door. By releasing it
undocumented and buggy, at least some of the (working!) demo programs,
like itr (my Internet Talk Radio browser) become available to a larger
audience.
* There are also modules interfacing to SGI's "Glx" widget (a GL
window wrapped in a widget) and to NCSA's "HTML" widget (which can
format HyperText Markup Language, the document format used by the
World Wide Web).
* I've experienced some problems when building the X11 support. In
particular, the Xm and Xaw widget sets don't go together, and it
appears that using X11R5 is better than using X11R4. Also the threads
module and its link time options may spoil things. My own strategy is
to build two Python binaries: one for use with X11 and one without
it, which can contain a richer set of built-in modules. Don't even
*think* of loading the X11 modules dynamically...
Environmental changes
---------------------
* Compiled files (*.pyc files) created by this Python version are
incompatible with those created by the previous version. Both
versions detect this and silently create a correct version, but it
means that it is not a good idea to use the same library directory for
an old and a new interpreter, since they will start to "fight" over
the *.pyc files...
* When a stack trace is printed, the exception is printed last instead
of first. This means that if the beginning of the stack trace
scrolled out of your window you can still see what exception caused
it.
* Sometimes interrupting a Python operation does not work because it
hangs in a blocking system call. You can now kill the interpreter by
interrupting it three times. The second time you interrupt it, a
message will be printed telling you that the third interrupt will kill
the interpreter. The "sys.exitfunc" feature still makes limited
clean-up possible in this case.
Changes to the command line interface
-------------------------------------
* The python usage message is now much more informative.
* New option -i enters interactive mode after executing a script --
useful for debugging.
* New option -k raises an exception when an expression statement
yields a value other than None.
* For each option there is now also a corresponding environment
variable.
Using Python as an embedded language
------------------------------------
* The distribution now contains (some) documentation on the use of
Python as an "embedded language" in other applications, as well as a
simple example. See the file misc/EMBEDDING and the directory embed/.
Speed improvements
------------------
* Function local variables are now generally stored in an array and
accessed using an integer indexing operation, instead of through a
dictionary lookup. (This compensates the somewhat slower dictionary
lookup caused by the generalization of the dictionary module.)
Changes to the syntax
---------------------
* Continuation lines can now *sometimes* be written without a
backslash: if the continuation is contained within nesting (), [] or
{} brackets the \ may be omitted. There's a much improved
python-mode.el in the misc directory which knows about this as well.
* You can no longer use an empty set of parentheses to define a class
without base classes. That is, you no longer write this:
class Foo(): # syntax error
...
You must write this instead:
class Foo:
...
This was already the preferred syntax in release 0.9.8 but many
people seemed not to have picked it up. There's a Python script that
fixes old code: demo/scripts/classfix.py.
* There's a new reserved word: "access". The syntax and semantics are
still subject of of research and debate (as well as undocumented), but
the parser knows about the keyword so you must not use it as a
variable, function, or attribute name.
Changes to the semantics of the language proper
-----------------------------------------------
* The following compatibility hack is removed: if a function was
defined with two or more arguments, and called with a single argument
that was a tuple with just as many arguments, the items of this tuple
would be used as the arguments. This is no longer supported.
Changes to the semantics of classes and instances
-------------------------------------------------
* Class variables are now also accessible as instance variables for
reading (assignment creates an instance variable which overrides the
class variable of the same name though).
* If a class attribute is a user-defined function, a new kind of
object is returned: an "unbound method". This contains a pointer to
the class and can only be called with a first argument which is a
member of that class (or a derived class).
* If a class defines a method __init__(self, arg1, ...) then this
method is called when a class instance is created by the classname()
construct. Arguments passed to classname() are passed to the
__init__() method. The __init__() methods of base classes are not
automatically called; the derived __init__() method must call these if
necessary (this was done so the derived __init__() method can choose
the call order and arguments for the base __init__() methods).
* If a class defines a method __del__(self) then this method is called
when an instance of the class is about to be destroyed. This makes it
possible to implement clean-up of external resources attached to the
instance. As with __init__(), the __del__() methods of base classes
are not automatically called. If __del__ manages to store a reference
to the object somewhere, its destruction is postponed; when the object
is again about to be destroyed its __del__() method will be called
again.
* Classes may define a method __hash__(self) to allow their instances
to be used as dictionary keys. This must return a 32-bit integer.
Minor improvements
------------------
* Function and class objects now know their name (the name given in
the 'def' or 'class' statement that created them).
* Class instances now know their class name.
Additions to built-in operations
--------------------------------
* The % operator with a string left argument implements formatting
similar to sprintf() in C. The right argument is either a single
value or a tuple of values. All features of Standard C sprintf() are
supported except %p.
* Dictionaries now support almost any key type, instead of just
strings. (The key type must be an immutable type or must be a class
instance where the class defines a method __hash__(), in order to
avoid losing track of keys whose value may change.)
* Built-in methods are now compared properly: when comparing x.meth1
and y.meth2, if x is equal to y and the methods are defined by the
same function, x.meth1 compares equal to y.meth2.
Additions to built-in functions
-------------------------------
* str(x) returns a string version of its argument. If the argument is
a string it is returned unchanged, otherwise it returns `x`.
* repr(x) returns the same as `x`. (Some users found it easier to
have this as a function.)
* round(x) returns the floating point number x rounded to an whole
number, represented as a floating point number. round(x, n) returns x
rounded to n digits.
* hasattr(x, name) returns true when x has an attribute with the given
name.
* hash(x) returns a hash code (32-bit integer) of an arbitrary
immutable object's value.
* id(x) returns a unique identifier (32-bit integer) of an arbitrary
object.
* compile() compiles a string to a Python code object.
* exec() and eval() now support execution of code objects.
Changes to the documented part of the library (standard modules)
----------------------------------------------------------------
* os.path.normpath() (a.k.a. posixpath.normpath()) has been fixed so
the border case '/foo/..' returns '/' instead of ''.
* A new function string.find() is added with similar semantics to
string.index(); however when it does not find the given substring it
returns -1 instead of raising string.index_error.
Changes to built-in modules
---------------------------
* New optional module 'array' implements operations on sequences of
integers or floating point numbers of a particular size. This is
useful to manipulate large numerical arrays or to read and write
binary files consisting of numerical data.
* Regular expression objects created by module regex now support a new
method named group(), which returns one or more \(...\) groups by number.
The number of groups is increased from 10 to 100.
* Function compile() in module regex now supports an optional mapping
argument; a variable casefold is added to the module which can be used
as a standard uppercase to lowercase mapping.
* Module time now supports many routines that are defined in the
Standard C time interface (<time.h>): gmtime(), localtime(),
asctime(), ctime(), mktime(), as well as these variables (taken from
System V): timezone, altzone, daylight and tzname. (The corresponding
functions in the undocumented module calendar have been removed; the
undocumented and unfinished module tzparse is now obsolete and will
disappear in a future release.)
* Module strop (the fast built-in version of standard module string)
now uses C's definition of whitespace instead of fixing it to space,
tab and newline; in practice this usually means that vertical tab,
form feed and return are now also considered whitespace. It exports
the string of characters that are considered whitespace as well as the
characters that are considered lowercase or uppercase.
* Module sys now defines the variable builtin_module_names, a list of
names of modules built into the current interpreter (including not
yet imported, but excluding two special modules that always have to be
defined -- sys and builtin).
* Objects created by module sunaudiodev now also support flush() and
close() methods.
* Socket objects created by module socket now support an optional
flags argument for their methods sendto() and recvfrom().
* Module marshal now supports dumping to and loading from strings,
through the functions dumps() and loads().
* Module stdwin now supports some new functionality. You may have to
ftp the latest version: ftp.cwi.nl:/pub/stdwin/stdwinforviews.tar.Z.)
Bugs fixed
----------
* Fixed comparison of negative long integers.
* The tokenizer no longer botches input lines longer than BUFSIZ.
* Fixed several severe memory leaks in module select.
* Fixed memory leaks in modules socket and sv.
* Fixed memory leak in divmod() for long integers.
* Problems with definition of floatsleep() on Suns fixed.
* Many portability bugs fixed (and undoubtedly new ones added :-).
Changes to the build procedure
------------------------------
* The Makefile supports some new targets: "make default" and "make
all". Both are by normally equivalent to "make python".
* The Makefile no longer uses $> since it's not supported by all
versions of Make.
* The header files now all contain #ifdef constructs designed to make
it safe to include the same header file twice, as well as support for
inclusion from C++ programs (automatic extern "C" { ... } added).
Freezing Python scripts
-----------------------
* There is now some support for "freezing" a Python script as a
stand-alone executable binary file. See the script
demo/scripts/freeze.py. It will require some site-specific tailoring
of the script to get this working, but is quite worthwhile if you write
Python code for other who may not have built and installed Python.
MS-DOS
------
* A new MS-DOS port has been done, using MSC 6.0 (I believe). Thanks,
Marcel van der Peijl! This requires fewer compatibility hacks in
posixmodule.c. The executable is not yet available but will be soon
(check the mailing list).
* The default PYTHONPATH has changed.
Changes for developers of extension modules
-------------------------------------------
* Read src/ChangeLog for full details.
SGI specific changes
--------------------
* Read src/ChangeLog for full details.
==================================
==> Release 0.9.8 (9 Jan 1993) <==
==================================
I claim no completeness here, but I've tried my best to scan the log
files throughout my source tree for interesting bits of news. A more
complete account of the changes is to be found in the various
ChangeLog files. See also "News for release 0.9.7beta" below if you're
still using release 0.9.6, and the file HISTORY if you have an even
older release.
--Guido
Changes to the language proper
------------------------------
There's only one big change: the conformance checking for function
argument lists (of user-defined functions only) is stricter. Earlier,
you could get away with the following:
(a) define a function of one argument and call it with any
number of arguments; if the actual argument count wasn't
one, the function would receive a tuple containing the
arguments arguments (an empty tuple if there were none).
(b) define a function of two arguments, and call it with more
than two arguments; if there were more than two arguments,
the second argument would be passed as a tuple containing
the second and further actual arguments.
(Note that an argument (formal or actual) that is a tuple is counted as
one; these rules don't apply inside such tuples, only at the top level
of the argument list.)
Case (a) was needed to accommodate variable-length argument lists;
there is now an explicit "varargs" feature (precede the last argument
with a '*'). Case (b) was needed for compatibility with old class
definitions: up to release 0.9.4 a method with more than one argument
had to be declared as "def meth(self, (arg1, arg2, ...)): ...".
Version 0.9.6 provide better ways to handle both casees, bot provided
backward compatibility; version 0.9.8 retracts the compatibility hacks
since they also cause confusing behavior if a function is called with
the wrong number of arguments.
There's a script that helps converting classes that still rely on (b),
provided their methods' first argument is called "self":
demo/scripts/methfix.py.
If this change breaks lots of code you have developed locally, try
#defining COMPAT_HACKS in ceval.c.
(There's a third compatibility hack, which is the reverse of (a): if a
function is defined with two or more arguments, and called with a
single argument that is a tuple with just as many arguments, the items
of this tuple will be used as the arguments. Although this can (and
should!) be done using the built-in function apply() instead, it isn't
withdrawn yet.)
One minor change: comparing instance methods works like expected, so
that if x is an instance of a user-defined class and has a method m,
then (x.m==x.m) yields 1.
The following was already present in 0.9.7beta, but not explicitly
mentioned in the NEWS file: user-defined classes can now define types
that behave in almost allrespects like numbers. See
demo/classes/Rat.py for a simple example.
Changes to the build process
----------------------------
The Configure.py script and the Makefile has been made somewhat more
bullet-proof, after reports of (minor) trouble on certain platforms.
There is now a script to patch Makefile and config.c to add a new
optional built-in module: Addmodule.sh. Read the script before using!
Useing Addmodule.sh, all optional modules can now be configured at
compile time using Configure.py, so there are no modules left that
require dynamic loading.
The Makefile has been fixed to make it easier to use with the VPATH
feature of some Make versions (e.g. SunOS).
Changes affecting portability
-----------------------------
Several minor portability problems have been solved, e.g. "malloc.h"
has been renamed to "mymalloc.h", "strdup.c" is no longer used, and
the system now tolerates malloc(0) returning 0.
For dynamic loading on the SGI, Jack Jansen's dl 1.6 is now
distributed with Python. This solves several minor problems, in
particular scripts invoked using #! can now use dynamic loading.
Changes to the interpreter interface
------------------------------------
On popular demand, there's finally a "profile" feature for interactive
use of the interpreter. If the environment variable $PYTHONSTARTUP is
set to the name of an existing file, Python statements in this file
are executed when the interpreter is started in interactive mode.
There is a new clean-up mechanism, complementing try...finally: if you
assign a function object to sys.exitfunc, it will be called when
Python exits or receives a SIGTERM or SIGHUP signal.
The interpreter is now generally assumed to live in
/usr/local/bin/python (as opposed to /usr/local/python). The script
demo/scripts/fixps.py will update old scripts in place (you can easily
modify it to do other similar changes).
Most I/O that uses sys.stdin/stdout/stderr will now use any object
assigned to those names as long as the object supports readline() or
write() methods.
The parser stack has been increased to 500 to accommodate more
complicated expressions (7 levels used to be the practical maximum,
it's now about 38).
The limit on the size of the *run-time* stack has completely been
removed -- this means that tuple or list displays can contain any
number of elements (formerly more than 50 would crash the
interpreter).
Changes to existing built-in functions and methods
--------------------------------------------------
The built-in functions int(), long(), float(), oct() and hex() now
also apply to class instalces that define corresponding methods
(__int__ etc.).
New built-in functions
----------------------
The new functions str() and repr() convert any object to a string.
The function repr(x) is in all respects equivalent to `x` -- some
people prefer a function for this. The function str(x) does the same
except if x is already a string -- then it returns x unchanged
(repr(x) adds quotes and escapes "funny" characters as octal escapes).
The new function cmp(x, y) returns -1 if x<y, 0 if x==y, 1 if x>y.
Changes to general built-in modules
-----------------------------------
The time module's functions are more general: time() returns a
floating point number and sleep() accepts one. Their accuracies
depends on the precision of the system clock. Millisleep is no longer
needed (although it still exists for now), but millitimer is still
needed since on some systems wall clock time is only available with
seconds precision, while a source of more precise time exists that
isn't synchronized with the wall clock. (On UNIX systems that support
the BSD gettimeofday() function, time.time() is as time.millitimer().)
The string representation of a file object now includes an address:
'<file 'filename', mode 'r' at #######>' where ###### is a hex number
(the object's address) to make it unique.
New functions added to posix: nice(), setpgrp(), and if your system
supports them: setsid(), setpgid(), tcgetpgrp(), tcsetpgrp().
Improvements to the socket module: socket objects have new methods
getpeername() and getsockname(), and the {get,set}sockopt methods can
now get/set any kind of option using strings built with the new struct
module. And there's a new function fromfd() which creates a socket
object given a file descriptor (useful for servers started by inetd,
which have a socket connected to stdin and stdout).
Changes to SGI-specific built-in modules
----------------------------------------
The FORMS library interface (fl) now requires FORMS 2.1a. Some new
functions have been added and some bugs have been fixed.
Additions to al (audio library interface): added getname(),
getdefault() and getminmax().
The gl modules doesn't call "foreground()" when initialized (this
caused some problems) like it dit in 0.9.7beta (but not before).
There's a new gl function 'gversion() which returns a version string.
The interface to sv (Indigo video interface) has totally changed.
(Sorry, still no documentation, but see the examples in
demo/sgi/{sv,video}.)
Changes to standard library modules
-----------------------------------
Most functions in module string are now much faster: they're actually
implemented in C. The module containing the C versions is called
"strop" but you should still import "string" since strop doesn't
provide all the interfaces defined in string (and strop may be renamed
to string when it is complete in a future release).
string.index() now accepts an optional third argument giving an index
where to start searching in the first argument, so you can find second
and further occurrences (this is similar to the regular expression
functions in regex).
The definition of what string.splitfields(anything, '') should return
is changed for the last time: it returns a singleton list containing
its whole first argument unchanged. This is compatible with
regsub.split() which also ignores empty delimiter matches.
posixpath, macpath: added dirname() and normpath() (and basename() to
macpath).
The mainloop module (for use with stdwin) can now demultiplex input
from other sources, as long as they can be polled with select().
New built-in modules
--------------------
Module struct defines functions to pack/unpack values to/from strings
representing binary values in native byte order.
Module strop implements C versions of many functions from string (see
above).
Optional module fcntl defines interfaces to fcntl() and ioctl() --
UNIX only. (Not yet properly documented -- see however src/fcntl.doc.)
Optional module mpz defines an interface to an altaernative long
integer implementation, the GNU MPZ library.
Optional module md5 uses the GNU MPZ library to calculate MD5
signatures of strings.
There are also optional new modules specific to SGI machines: imageop
defines some simple operations to images represented as strings; sv
interfaces to the Indigo video board; cl interfaces to the (yet
unreleased) compression library.
New standard library modules
----------------------------
(Unfortunately the following modules are not all documented; read the
sources to find out more about them!)
autotest: run testall without showing any output unless it differs
from the expected output
bisect: use bisection to insert or find an item in a sorted list
colorsys: defines conversions between various color systems (e.g. RGB
<-> YUV)
nntplib: a client interface to NNTP servers
pipes: utility to construct pipeline from templates, e.g. for
conversion from one file format to another using several utilities.
regsub: contains three functions that are more or less compatible with
awk functions of the same name: sub() and gsub() do string
substitution, split() splits a string using a regular expression to
define how separators are define.
test_types: test operations on the built-in types of Python
toaiff: convert various audio file formats to AIFF format
tzparse: parse the TZ environment parameter (this may be less general
than it could be, let me know if you fix it).
(Note that the obsolete module "path" no longer exists.)
New SGI-specific library modules
--------------------------------
CL: constants for use with the built-in compression library interface (cl)
Queue: a multi-producer, multi-consumer queue class implemented for
use with the built-in thread module
SOCKET: constants for use with built-in module socket, e.g. to set/get
socket options. This is SGI-specific because the constants to be
passed are system-dependent. You can generate a version for your own
system by running the script demo/scripts/h2py.py with
/usr/include/sys/socket.h as input.
cddb: interface to the database used by the CD player
torgb: convert various image file types to rgb format (requires pbmplus)
New demos
---------
There's an experimental interface to define Sun RPC clients and
servers in demo/rpc.
There's a collection of interfaces to WWW, WAIS and Gopher (both
Python classes and program providing a user interface) in demo/www.
This includes a program texi2html.py which converts texinfo files to
HTML files (the format used hy WWW).
The ibrowse demo has moved from demo/stdwin/ibrowse to demo/ibrowse.
For SGI systems, there's a whole collection of programs and classes
that make use of the Indigo video board in demo/sgi/{sv,video}. This
represents a significant amount of work that we're giving away!
There are demos "rsa" and "md5test" that exercise the mpz and md5
modules, respectively. The rsa demo is a complete implementation of
the RSA public-key cryptosystem!
A bunch of games and examples submitted by Stoffel Erasmus have been
included in demo/stoffel.
There are miscellaneous new files in some existing demo
subdirectories: classes/bitvec.py, scripts/{fixps,methfix}.py,
sgi/al/cmpaf.py, sockets/{mcast,gopher}.py.
There are also many minor changes to existing files, but I'm too lazy
to run a diff and note the differences -- you can do this yourself if
you save the old distribution's demos. One highlight: the
stdwin/python.py demo is much improved!
Changes to the documentation
----------------------------
The LaTeX source for the library uses different macros to enable it to
be converted to texinfo, and from there to INFO or HTML format so it
can be browsed as a hypertext. The net result is that you can now
read the Python library documentation in Emacs info mode!
Changes to the source code that affect C extension writers
----------------------------------------------------------
The function strdup() no longer exists (it was used only in one places
and is somewhat of a a portability problem sice some systems have the
same function in their C library.
The functions NEW() and RENEW() allocate one spare byte to guard
against a NULL return from malloc(0) being taken for an error, but
this should not be relied upon.
=========================
==> Release 0.9.7beta <==
=========================
Changes to the language proper
------------------------------
User-defined classes can now implement operations invoked through
special syntax, such as x[i] or `x` by defining methods named
__getitem__(self, i) or __repr__(self), etc.
Changes to the build process
----------------------------
Instead of extensive manual editing of the Makefile to select
compile-time options, you can now run a Configure.py script.
The Makefile as distributed builds a minimal interpreter sufficient to
run Configure.py. See also misc/BUILD
The Makefile now includes more "utility" targets, e.g. install and
tags/TAGS
Using the provided strtod.c and strtol.c are now separate options, as
on the Sun the provided strtod.c dumps core :-(
The regex module is now an option chosen by the Makefile, since some
(old) C compilers choke on regexpr.c
Changes affecting portability
-----------------------------
You need STDWIN version 0.9.7 (released 30 June 1992) for the stdwin
interface
Dynamic loading is now supported for Sun (and other non-COFF systems)
throug dld-3.2.3, as well as for SGI (a new version of Jack Jansen's
DL is out, 1.4)
The system-dependent code for the use of the select() system call is
moved to one file: myselect.h
Thanks to Jaap Vermeulen, the code should now port cleanly to the
SEQUENT
Changes to the interpreter interface
------------------------------------
The interpretation of $PYTHONPATH in the environment is different: it
is inserted in front of the default path instead of overriding it
Changes to existing built-in functions and methods
--------------------------------------------------
List objects now support an optional argument to their sort() method,
which is a comparison function similar to qsort(3) in C
File objects now have a method fileno(), used by the new select module
(see below)
New built-in function
---------------------
coerce(x, y): take two numbers and return a tuple containing them
both converted to a common type
Changes to built-in modules
---------------------------
sys: fixed core dumps in settrace() and setprofile()
socket: added socket methods setsockopt() and getsockopt(); and
fileno(), used by the new select module (see below)
stdwin: added fileno() == connectionnumber(), in support of new module
select (see below)
posix: added get{eg,eu,g,u}id(); waitpid() is now a separate function.
gl: added qgetfd()
fl: added several new functions, fixed several obscure bugs, adapted
to FORMS 2.1
Changes to standard modules
---------------------------
posixpath: changed implementation of ismount()
string: atoi() no longer mistakes leading zero for octal number
...
New built-in modules
--------------------
Modules marked "dynamic only" are not configured at compile time but
can be loaded dynamically. You need to turn on the DL or DLD option in
the Makefile for support dynamic loading of modules (this requires
external code).
select: interfaces to the BSD select() system call
dbm: interfaces to the (new) dbm library (dynamic only)
nis: interfaces to some NIS functions (aka yellow pages)
thread: limited form of multiple threads (sgi only)
audioop: operations useful for audio programs, e.g. u-LAW and ADPCM
coding (dynamic only)
cd: interface to Indigo SCSI CDROM player audio library (sgi only)
jpeg: read files in JPEG format (dynamic only, sgi only; needs
external code)
imgfile: read SGI image files (dynamic only, sgi only)
sunaudiodev: interface to sun's /dev/audio (dynamic only, sun only)
sv: interface to Indigo video library (sgi only)
pc: a minimal set of MS-DOS interfaces (MS-DOS only)
rotor: encryption, by Lance Ellinghouse (dynamic only)
New standard modules
--------------------
Not all these modules are documented. Read the source:
lib/<modulename>.py. Sometimes a file lib/<modulename>.doc contains
additional documentation.
imghdr: recognizes image file headers
sndhdr: recognizes sound file headers
profile: print run-time statistics of Python code
readcd, cdplayer: companion modules for built-in module cd (sgi only)
emacs: interface to Emacs using py-connect.el (see below).
SOCKET: symbolic constant definitions for socket options
SUNAUDIODEV: symbolic constant definitions for sunaudiodef (sun only)
SV: symbolic constat definitions for sv (sgi only)
CD: symbolic constat definitions for cd (sgi only)
New demos
---------
scripts/pp.py: execute Python as a filter with a Perl-like command
line interface
classes/: examples using the new class features
threads/: examples using the new thread module
sgi/cd/: examples using the new cd module
Changes to the documentation
----------------------------
The last-minute syntax changes of release 0.9.6 are now reflected
everywhere in the manuals
The reference manual has a new section (3.2) on implementing new kinds
of numbers, sequences or mappings with user classes
Classes are now treated extensively in the tutorial (chapter 9)
Slightly restructured the system-dependent chapters of the library
manual
The file misc/EXTENDING incorporates documentation for mkvalue() and
a new section on error handling
The files misc/CLASSES and misc/ERRORS are no longer necessary
The doc/Makefile now creates PostScript files automatically
Miscellaneous changes
---------------------
Incorporated Tim Peters' changes to python-mode.el, it's now version
1.06
A python/Emacs bridge (provided by Terrence M. Brannon) lets a Python
program running in an Emacs buffer execute Emacs lisp code. The
necessary Python code is in lib/emacs.py. The Emacs code is
misc/py-connect.el (it needs some external Emacs lisp code)
Changes to the source code that affect C extension writers
----------------------------------------------------------
New service function mkvalue() to construct a Python object from C
values according to a "format" string a la getargs()
Most functions from pythonmain.c moved to new pythonrun.c which is
in libpython.a. This should make embedded versions of Python easier
ceval.h is split in eval.h (which needs compile.h and only declares
eval_code) and ceval.h (which doesn't need compile.hand declares the
rest)
ceval.h defines macros BGN_SAVE / END_SAVE for use with threads (to
improve the parallellism of multi-threaded programs by letting other
Python code run when a blocking system call or something similar is
made)
In structmember.[ch], new member types BYTE, CHAR and unsigned
variants have been added
New file xxmodule.c is a template for new extension modules.
==================================
==> Release 0.9.6 (6 Apr 1992) <==
==================================
Misc news in 0.9.6:
- Restructured the misc subdirectory
- Reference manual completed, library manual much extended (with indexes!)
- the GNU Readline library is now distributed standard with Python
- the script "../demo/scripts/classfix.py" fixes Python modules using old
class syntax
- Emacs python-mode.el (was python.el) vastly improved (thanks, Tim!)
- Because of the GNU copyleft business I am not using the GNU regular
expression implementation but a free re-implementation by Tatu Ylonen
that recently appeared in comp.sources.misc (Bravo, Tatu!)
New features in 0.9.6:
- stricter try stmt syntax: cannot mix except and finally clauses on 1 try
- New module 'os' supplants modules 'mac' and 'posix' for most cases;
module 'path' is replaced by 'os.path'
- os.path.split() return value differs from that of old path.split()
- sys.exc_type, sys.exc_value, sys.exc_traceback are set to the exception
currently being handled
- sys.last_type, sys.last_value, sys.last_traceback remember last unhandled
exception
- New function string.expandtabs() expands tabs in a string
- Added times() interface to posix (user & sys time of process & children)
- Added uname() interface to posix (returns OS type, hostname, etc.)
- New built-in function execfile() is like exec() but from a file
- Functions exec() and eval() are less picky about whitespace/newlines
- New built-in functions getattr() and setattr() access arbitrary attributes
- More generic argument handling in built-in functions (see "./EXTENDING")
- Dynamic loading of modules written in C or C++ (see "./DYNLOAD")
- Division and modulo for long and plain integers with negative operands
have changed; a/b is now floor(float(a)/float(b)) and a%b is defined
as a-(a/b)*b. So now the outcome of divmod(a,b) is the same as
(a/b, a%b) for integers. For floats, % is also changed, but of course
/ is unchanged, and divmod(x,y) does not yield (x/y, x%y)...
- A function with explicit variable-length argument list can be declared
like this: def f(*args): ...; or even like this: def f(a, b, *rest): ...
- Code tracing and profiling features have been added, and two source
code debuggers are provided in the library (pdb.py, tty-oriented,
and wdb, window-oriented); you can now step through Python programs!
See sys.settrace() and sys.setprofile(), and "../lib/pdb.doc"
- '==' is now the only equality operator; "../demo/scripts/eqfix.py" is
a script that fixes old Python modules
- Plain integer right shift now uses sign extension
- Long integer shift/mask operations now simulate 2's complement
to give more useful results for negative operands
- Changed/added range checks for long/plain integer shifts
- Options found after "-c command" are now passed to the command in sys.argv
(note subtle incompatiblity with "python -c command -- -options"!)
- Module stdwin is better protected against touching objects after they've
been closed; menus can now also be closed explicitly
- Stdwin now uses its own exception (stdwin.error)
New features in 0.9.5 (released as Macintosh application only, 2 Jan 1992):
- dictionary objects can now be compared properly; e.g., {}=={} is true
- new exception SystemExit causes termination if not caught;
it is raised by sys.exit() so that 'finally' clauses can clean up,
and it may even be caught. It does work interactively!
- new module "regex" implements GNU Emacs style regular expressions;
module "regexp" is rewritten in Python for backward compatibility
- formal parameter lists may contain trailing commas
Bugs fixed in 0.9.6:
- assigning to or deleting a list item with a negative index dumped core
- divmod(-10L,5L) returned (-3L, 5L) instead of (-2L, 0L)
Bugs fixed in 0.9.5:
- masking operations involving negative long integers gave wrong results
===================================
==> Release 0.9.4 (24 Dec 1991) <==
===================================
- new function argument handling (see below)
- built-in apply(func, args) means func(args[0], args[1], ...)
- new, more refined exceptions
- new exception string values (NameError = 'NameError' etc.)
- better checking for math exceptions
- for sequences (string/tuple/list), x[-i] is now equivalent to x[len(x)-i]
- fixed list assignment bug: "a[1:1] = a" now works correctly
- new class syntax, without extraneous parentheses
- new 'global' statement to assign global variables from within a function
New class syntax
----------------
You can now declare a base class as follows:
class B: # Was: class B():
def some_method(self): ...
...
and a derived class thusly:
class D(B): # Was: class D() = B():
def another_method(self, arg): ...
Multiple inheritance looks like this:
class M(B, D): # Was: class M() = B(), D():
def this_or_that_method(self, arg): ...
The old syntax is still accepted by Python 0.9.4, but will disappear
in Python 1.0 (to be posted to comp.sources).
New 'global' statement
----------------------
Every now and then you have a global variable in a module that you
want to change from within a function in that module -- say, a count
of calls to a function, or an option flag, etc. Until now this was
not directly possible. While several kludges are known that
circumvent the problem, and often the need for a global variable can
be avoided by rewriting the module as a class, this does not always
lead to clearer code.
The 'global' statement solves this dilemma. Its occurrence in a
function body means that, for the duration of that function, the
names listed there refer to global variables. For instance:
total = 0.0
count = 0
def add_to_total(amount):
global total, count
total = total + amount
count = count + 1
'global' must be repeated in each function where it is needed. The
names listed in a 'global' statement must not be used in the function
before the statement is reached.
Remember that you don't need to use 'global' if you only want to *use*
a global variable in a function; nor do you need ot for assignments to
parts of global variables (e.g., list or dictionary items or
attributes of class instances). This has not changed; in fact
assignment to part of a global variable was the standard workaround.
New exceptions
--------------
Several new exceptions have been defined, to distinguish more clearly
between different types of errors.
name meaning was
AttributeError reference to non-existing attribute NameError
IOError unexpected I/O error RuntimeError
ImportError import of non-existing module or name NameError
IndexError invalid string, tuple or list index RuntimeError
KeyError key not in dictionary RuntimeError
OverflowError numeric overflow RuntimeError
SyntaxError invalid syntax RuntimeError
ValueError invalid argument value RuntimeError
ZeroDivisionError division by zero RuntimeError
The string value of each exception is now its name -- this makes it
easier to experimentally find out which operations raise which
exceptions; e.g.:
>>> KeyboardInterrupt
'KeyboardInterrupt'
>>>
New argument passing semantics
------------------------------
Off-line discussions with Steve Majewski and Daniel LaLiberte have
convinced me that Python's parameter mechanism could be changed in a
way that made both of them happy (I hope), kept me happy, fixed a
number of outstanding problems, and, given some backward compatibility
provisions, would only break a very small amount of existing code --
probably all mine anyway. In fact I suspect that most Python users
will hardly notice the difference. And yet it has cost me at least
one sleepless night to decide to make the change...
Philosophically, the change is quite radical (to me, anyway): a
function is no longer called with either zero or one argument, which
is a tuple if there appear to be more arguments. Every function now
has an argument list containing 0, 1 or more arguments. This list is
always implemented as a tuple, and it is a (run-time) error if a
function is called with a different number of arguments than expected.
What's the difference? you may ask. The answer is, very little unless
you want to write variadic functions -- functions that may be called
with a variable number of arguments. Formerly, you could write a
function that accepted one or more arguments with little trouble, but
writing a function that could be called with either 0 or 1 argument
(or more) was next to impossible. This is now a piece of cake: you
can simply declare an argument that receives the entire argument
tuple, and check its length -- it will be of size 0 if there are no
arguments.
Another anomaly of the old system was the way multi-argument methods
(in classes) had to be declared, e.g.:
class Point():
def init(self, (x, y, color)): ...
def setcolor(self, color): ...
dev moveto(self, (x, y)): ...
def draw(self): ...
Using the new scheme there is no need to enclose the method arguments
in an extra set of parentheses, so the above class could become:
class Point:
def init(self, x, y, color): ...
def setcolor(self, color): ...
dev moveto(self, x, y): ...
def draw(self): ...
That is, the equivalence rule between methods and functions has
changed so that now p.moveto(x,y) is equivalent to Point.moveto(p,x,y)
while formerly it was equivalent to Point.moveto(p,(x,y)).
A special backward compatibility rule makes that the old version also
still works: whenever a function with exactly two arguments (at the top
level) is called with more than two arguments, the second and further
arguments are packed into a tuple and passed as the second argument.
This rule is invoked independently of whether the function is actually a
method, so there is a slight chance that some erroneous calls of
functions expecting two arguments with more than that number of
arguments go undetected at first -- when the function tries to use the
second argument it may find it is a tuple instead of what was expected.
Note that this rule will be removed from future versions of the
language; it is a backward compatibility provision *only*.
Two other rules and a new built-in function handle conversion between
tuples and argument lists:
Rule (a): when a function with more than one argument is called with a
single argument that is a tuple of the right size, the tuple's items
are used as arguments.
Rule (b): when a function with exactly one argument receives no
arguments or more than one, that one argument will receive a tuple
containing the arguments (the tuple will be empty if there were no
arguments).
A new built-in function, apply(), was added to support functions that
need to call other functions with a constructed argument list. The call
apply(function, tuple)
is equivalent to
function(tuple[0], tuple[1], ..., tuple[len(tuple)-1])
While no new argument syntax was added in this phase, it would now be
quite sensible to add explicit syntax to Python for default argument
values (as in C++ or Modula-3), or a "rest" argument to receive the
remaining arguments of a variable-length argument list.
========================================================
==> Release 0.9.3 (never made available outside CWI) <==
========================================================
- string sys.version shows current version (also printed on interactive entry)
- more detailed exceptions, e.g., IOError, ZeroDivisionError, etc.
- 'global' statement to declare module-global variables assigned in functions.
- new class declaration syntax: class C(Base1, Base2, ...): suite
(the old syntax is still accepted -- be sure to convert your classes now!)
- C shifting and masking operators: << >> ~ & ^ | (for ints and longs).
- C comparison operators: == != (the old = and <> remain valid).
- floating point numbers may now start with a period (e.g., .14).
- definition of integer division tightened (always truncates towards zero).
- new builtins hex(x), oct(x) return hex/octal string from (long) integer.
- new list method l.count(x) returns the number of occurrences of x in l.
- new SGI module: al (Indigo and 4D/35 audio library).
- the FORMS interface (modules fl and FL) now uses FORMS 2.0
- module gl: added lrect{read,write}, rectzoom and pixmode;
added (non-GL) functions (un)packrect.
- new socket method: s.allowbroadcast(flag).
- many objects support __dict__, __methods__ or __members__.
- dir() lists anything that has __dict__.
- class attributes are no longer read-only.
- classes support __bases__, instances support __class__ (and __dict__).
- divmod() now also works for floats.
- fixed obscure bug in eval('1 ').
===================================
==> Release 0.9.2 (Autumn 1991) <==
===================================
Highlights
----------
- tutorial now (almost) complete; library reference reorganized
- new syntax: continue statement; semicolons; dictionary constructors;
restrictions on blank lines in source files removed
- dramatically improved module load time through precompiled modules
- arbitrary precision integers: compute 2 to the power 1000 and more...
- arithmetic operators now accept mixed type operands, e.g., 3.14/4
- more operations on list: remove, index, reverse; repetition
- improved/new file operations: readlines, seek, tell, flush, ...
- process management added to the posix module: fork/exec/wait/kill etc.
- BSD socket operations (with example servers and clients!)
- many new STDWIN features (color, fonts, polygons, ...)
- new SGI modules: font manager and FORMS library interface
Extended list of changes in 0.9.2
---------------------------------
Here is a summary of the most important user-visible changes in 0.9.2,
in somewhat arbitrary order. Changes in later versions are listed in
the "highlights" section above.
1. Changes to the interpreter proper
- Simple statements can now be separated by semicolons.
If you write "if t: s1; s2", both s1 and s2 are executed
conditionally.
- The 'continue' statement was added, with semantics as in C.
- Dictionary displays are now allowed on input: {key: value, ...}.
- Blank lines and lines bearing only a comment no longer need to
be indented properly. (A completely empty line still ends a multi-
line statement interactively.)
- Mixed arithmetic is supported, 1 compares equal to 1.0, etc.
- Option "-c command" to execute statements from the command line
- Compiled versions of modules are cached in ".pyc" files, giving a
dramatic improvement of start-up time
- Other, smaller speed improvements, e.g., extracting characters from
strings, looking up single-character keys, and looking up global
variables
- Interrupting a print operation raises KeyboardInterrupt instead of
only cancelling the print operation
- Fixed various portability problems (it now passes gcc with only
warnings -- more Standard C compatibility will be provided in later
versions)
- Source is prepared for porting to MS-DOS
- Numeric constants are now checked for overflow (this requires
standard-conforming strtol() and strtod() functions; a correct
strtol() implementation is provided, but the strtod() provided
relies on atof() for everything, including error checking
2. Changes to the built-in types, functions and modules
- New module socket: interface to BSD socket primitives
- New modules pwd and grp: access the UNIX password and group databases
- (SGI only:) New module "fm" interfaces to the SGI IRIX Font Manager
- (SGI only:) New module "fl" interfaces to Mark Overmars' FORMS library
- New numeric type: long integer, for unlimited precision
- integer constants suffixed with 'L' or 'l' are long integers
- new built-in function long(x) converts int or float to long
- int() and float() now also convert from long integers
- New built-in function:
- pow(x, y) returns x to the power y
- New operation and methods for lists:
- l*n returns a new list consisting of n concatenated copies of l
- l.remove(x) removes the first occurrence of the value x from l
- l.index(x) returns the index of the first occurrence of x in l
- l.reverse() reverses l in place
- New operation for tuples:
- t*n returns a tuple consisting of n concatenated copies of t
- Improved file handling:
- f.readline() no longer restricts the line length, is faster,
and isn't confused by null bytes; same for raw_input()
- f.read() without arguments reads the entire (rest of the) file
- mixing of print and sys.stdout.write() has different effect
- New methods for files:
- f.readlines() returns a list containing the lines of the file,
as read with f.readline()
- f.flush(), f.tell(), f.seek() call their stdio counterparts
- f.isatty() tests for "tty-ness"
- New posix functions:
- _exit(), exec(), fork(), getpid(), getppid(), kill(), wait()
- popen() returns a file object connected to a pipe
- utime() replaces utimes() (the latter is not a POSIX name)
- New stdwin features, including:
- font handling
- color drawing
- scroll bars made optional
- polygons
- filled and xor shapes
- text editing objects now have a 'settext' method
3. Changes to the standard library
- Name change: the functions path.cat and macpath.cat are now called
path.join and macpath.join
- Added new modules: formatter, mutex, persist, sched, mainloop
- Added some modules and functionality to the "widget set" (which is
still under development, so please bear with me):
DirList, FormSplit, TextEdit, WindowSched
- Fixed module testall to work non-interactively
- Module string:
- added functions join() and joinfields()
- fixed center() to work correct and make it "transitive"
- Obsolete modules were removed: util, minmax
- Some modules were moved to the demo directory
4. Changes to the demonstration programs
- Added new useful scipts: byteyears, eptags, fact, from, lfact,
objgraph, pdeps, pi, primes, ptags, which
- Added a bunch of socket demos
- Doubled the speed of ptags
- Added new stdwin demos: microedit, miniedit
- Added a windowing interface to the Python interpreter: python (most
useful on the Mac)
- Added a browser for Emacs info files: demo/stdwin/ibrowse
(yes, I plan to put all STDWIN and Python documentation in texinfo
form in the future)
5. Other changes to the distribution
- An Emacs Lisp file "python.el" is provided to facilitate editing
Python programs in GNU Emacs (slightly improved since posted to
gnu.emacs.sources)
- Some info on writing an extension in C is provided
- Some info on building Python on non-UNIX platforms is provided
=====================================
==> Release 0.9.1 (February 1991) <==
=====================================
- Micro changes only
- Added file "patchlevel.h"
=====================================
==> Release 0.9.0 (February 1991) <==
=====================================
Original posting to alt.sources.
|