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
|
===================
astroid's ChangeLog
===================
What's New in astroid 4.1.0?
============================
Release date: TBA
What's New in astroid 4.0.3?
============================
Release date: TBA
What's New in astroid 4.0.2?
============================
Release date: 2025-11-09
* Handle FunctionDef blockstart_tolineno edge cases correctly.
Refs #2880
* Add ``HTTPMethod`` enum support to brain module for Python 3.11+.
Refs pylint-dev/pylint#10624
Closes #2877
What's New in astroid 4.0.1?
============================
Release date: 2025-10-11
* Suppress ``SyntaxWarning`` for invalid escape sequences and return in finally on
Python 3.14 when parsing modules.
* Assign ``Import`` and ``ImportFrom`` nodes to module locals if used with ``global``.
Closes pylint-dev/pylint#10632
What's New in astroid 4.0.0?
============================
Release date: 2025-10-05
* Support constraints from ternary expressions in inference.
Closes pylint-dev/pylint#9729
* Handle deprecated `bool(NotImplemented)` cast in const nodes.
* Add support for boolean truthiness constraints (`x`, `not x`) in inference.
Closes pylint-dev/pylint#9515
* Fix false positive `invalid-name` on `attrs` classes with `ClassVar` annotated variables.
Closes pylint-dev/pylint#10525
* Prevent crash when parsing deeply nested parentheses causing MemoryError in python's built-in ast.
Closes #2643
* Fix crash when inferring namedtuple with invalid field name looking like f-string formatting.
Closes #2519
* Fix false positive no-member in except * handler.
Closes pylint-dev/pylint#9056
* Fix crash when comparing invalid dict literal
Closes #2522
* Removed internal functions ``infer_numpy_member``, ``name_looks_like_numpy_member``, and
``attribute_looks_like_numpy_member`` from ``astroid.brain.brain_numpy_utils``.
* To alleviate circular imports, the ``manager`` argument to ``AstroidBuilder()`` is now required.
* Constants now have a parent of ``nodes.SYNTHETIC_ROOT``.
* Fix crashes with large positive and negative list multipliers.
Closes #2521
Closes #2523
* Fix precedence of `path` arg in `modpath_from_file_with_callback` to be higher than `sys.path`
* Following a deprecation period, the ``future`` argument was removed from ``statement()`` and ``frame()``.
* Improve consistency of ``JoinedStr`` inference by not raising ``InferenceError`` and
returning either ``Uninferable`` or a fully resolved ``Const``.
Closes #2621
* Fix crash when typing._alias() call is missing arguments.
Closes #2513
* Remove support for Python 3.9 (and constant `PY310_PLUS`).
* Include subclasses of standard property classes as `property` decorators
Closes #10377
* Modify ``astroid.bases`` and ``tests.test_nodes`` to reflect that `enum.property` was added in Python 3.11, not 3.10
* Fix incorrect result in `_get_relative_base_path` when the target directory name starts with the base path
Closes #2608
* The brain for nose was dropped. nose has been deprecated for 10 years and the brain required some maintenance.
Refs #2765
* Fix a crash when the root of a node is not a module but is unknown.
Closes #2672
* Add basic support for ``ast.TemplateStr`` and ``ast.Interpolation``added in Python 3.14.
Refs #2789
* Add support for type parameter defaults added in Python 3.13.
* Improve ``as_string()`` representation for ``TypeVar``, ``ParamSpec`` and ``TypeVarTuple`` nodes, as well as
type parameter in ``ClassDef``, ``FuncDef`` and ``TypeAlias`` nodes (PEP 695).
* Astroid now correctly supports the ``exceptions`` attribute of ``ExceptionGroup``.
Closes pylint-dev/pylint#8985
Closes pylint-dev/pylint#10558
* Deprecate importing node classes from ``astroid`` directly. This will be removed in v5.
It's recommended to import them from ``astroid.nodes`` instead.
Refs #2837
What's New in astroid 3.3.11?
=============================
Release date: 2025-07-13
* Fix a crash when parsing an empty arbitrary expression with ``extract_node`` (``extract_node("__()")``).
Closes #2734
* Fix a crash when parsing a slice called in a decorator on a function that is also decorated with
a known ``six`` decorator.
Closes #2721
What's New in astroid 3.3.10?
=============================
Release date: 2025-05-10
* Avoid importing submodules sharing names with standard library modules.
Closes #2684
* Fix bug where ``pylint code.custom_extension`` would analyze ``code.py`` or ``code.pyi`` instead if they existed.
Closes pylint-dev/pylint#3631
What's New in astroid 3.3.9?
============================
Release date: 2025-03-09
* Fix crash when `sys.modules` contains lazy loader objects during checking.
Closes #2686
Closes pylint-dev/pylint#8589
* Upload release assets to PyPI via Trusted Publishing.
Refs pylint-dev/pylint#10256
What's New in astroid 3.3.8?
============================
Release date: 2024-12-23
* Fix inability to import `collections.abc` in python 3.13.1. The reported fixes in astroid 3.3.6
and 3.3.7 did not actually fix this issue.
Closes pylint-dev/pylint#10112
What's New in astroid 3.3.7?
============================
Release date: 2024-12-20
This release was yanked.
* Fix inability to import `collections.abc` in python 3.13.1. The reported fix in astroid 3.3.6
did not actually fix this issue.
Closes pylint-dev/pylint#10112
What's New in astroid 3.3.6?
============================
Release date: 2024-12-08
* Fix inability to import `collections.abc` in python 3.13.1.
_It was later found that this did not resolve the linked issue. It was fixed in astroid 3.3.7_
Closes pylint-dev/pylint#10112
* Fix crash when typing._alias() call is missing arguments.
Closes #2513
What's New in astroid 3.3.5?
============================
Release date: 2024-10-04
* Control setting local nodes outside of the supposed local's constructor.
Closes #1490
* Fix Python 3.13 compatibility re: `collections.abc`
Closes pylint-dev/pylint#10000
What's New in astroid 3.3.4?
============================
Release date: 2024-09-23
* Fix regression with f-string inference.
Closes pylint-dev/pylint#9947
* Fix bug with ``manager.clear_cache()`` not fully clearing cache.
Refs https://github.com/pylint-dev/pylint/pull/9932#issuecomment-2364985551
* Fix a crash from inferring empty format specs.
Closes pylint-dev/pylint#9945
What's New in astroid 3.3.3?
============================
Release date: 2024-09-20
* Fix inference regression with property setters.
Closes pylint-dev/pylint#9811
* Add annotation-only instance attributes to attrs classes to fix `no-member` false positives.
Closes #2514
What's New in astroid 3.3.2?
============================
Release date: 2024-08-11
* Restore support for soft-deprecated members of the ``typing`` module with python 3.13.
Refs pylint-dev/pylint#9852
What's New in astroid 3.3.1?
============================
Release date: 2024-08-06
* Fix a crash introduced in 3.3.0 involving invalid format strings.
Closes #2492
What's New in astroid 3.3.0?
============================
Release date: 2024-08-04
* Add support for Python 3.13.
* Remove support for Python 3.8 (and constants `PY38`, `PY39_PLUS`, and `PYPY_7_3_11_PLUS`).
Refs #2443
* Add the ``__annotations__`` attribute to the ``ClassDef`` object model.
Closes pylint-dev/pylint#7126
* Implement inference for JoinedStr and FormattedValue
* Add support for ``ssl.OP_LEGACY_SERVER_CONNECT`` (new in Python 3.12).
Closes pylint-dev/pylint#9849
What's New in astroid 3.2.4?
============================
Release date: 2024-07-20
* Avoid reporting unary/binary op type errors when inference is ambiguous.
Closes #2467
What's New in astroid 3.2.3?
============================
Release date: 2024-07-11
* Fix ``AssertionError`` when inferring a property consisting of a partial function.
Closes pylint-dev/pylint#9214
What's New in astroid 3.2.2?
============================
Release date: 2024-05-20
* Improve inference for generic classes using the PEP 695 syntax (Python 3.12).
Closes pylint-dev/pylint#9406
What's New in astroid 3.2.1?
============================
Release date: 2024-05-16
* Fix ``RecursionError`` in ``infer_call_result()`` for certain ``__call__`` methods.
Closes pylint-dev/pylint#9139
* Add ``AstroidManager.prefer_stubs`` attribute to control the astroid 3.2.0 feature that prefers stubs.
Refs pylint-dev/pylint#9626
Refs pylint-dev/pylint#9623
What's New in astroid 3.2.0?
============================
Release date: 2024-05-07
* ``.pyi`` stub files are now preferred over ``.py`` files when resolving imports, (except for numpy).
Closes pylint-dev/#9185
* ``igetattr()`` returns the last same-named function in a class (instead of
the first). This avoids false positives in pylint with ``@overload``.
Closes #1015
Refs pylint-dev/pylint#4696
* Adds ``module_denylist`` to ``AstroidManager`` for modules to be skipped during AST
generation. Modules in this list will cause an ``AstroidImportError`` to be raised
when an AST for them is requested.
Refs pylint-dev/pylint#9442
* Make ``astroid.interpreter._import.util.is_namespace`` only consider modules
using a loader set to ``NamespaceLoader`` or ``None`` as namespaces.
This fixes a problem that ``six.moves`` brain was not effective if ``six.moves``
was already imported.
Closes #1107
What's New in astroid 3.1.0?
============================
Release date: 2024-02-23
* Include PEP 695 (Python 3.12) generic type syntax nodes in ``get_children()``,
allowing checkers to visit them.
Refs pylint-dev/pylint#9193
* Add ``__main__`` as a possible inferred value for ``__name__`` to improve
control flow inference around ``if __name__ == "__main__":`` guards.
Closes #2071
* Following a deprecation period, the ``names`` arg to the ``Import`` constructor and
the ``op`` arg to the ``BoolOp`` constructor are now required, and the ``doc`` args
to the ``PartialFunction`` and ``Property`` constructors have been removed (call
``postinit(doc_node=...)`` instead.)
* Following a deprecation announced in astroid 1.5.0, the alias ``AstroidBuildingException`` is removed in favor of ``AstroidBuildingError``.
* Include modname in AST warnings. Useful for ``invalid escape sequence`` warnings
with Python 3.12.
* ``RecursionError`` is now trapped and logged out as ``UserWarning`` during astroid node transformations with instructions about raising the system recursion limit.
Closes pylint-dev/pylint#8842
* Suppress ``SyntaxWarning`` for invalid escape sequences on Python 3.12 when parsing modules.
Closes pylint-dev/pylint#9322
What's New in astroid 3.0.3?
============================
Release date: 2024-02-04
* Fix type of ``UnicodeDecodeError.object`` inferred as ``str`` instead of ``bytes``.
Closes pylint-dev/pylint#9342
* Fix ``no-member`` false positives for ``args`` and ``kwargs`` on ``ParamSpec`` under Python 3.12.
Closes pylint-dev/pylint#9401
What's New in astroid 3.0.2?
============================
Release date: 2023-12-12
* Avoid duplicate inference results for some uses of ``typing.X`` constructs like
``Tuple[Optional[int], ...]``. This was causing pylint to occasionally omit
messages like ``deprecated-typing-alias``.
Closes pylint-dev/pylint#9220
What's New in astroid 3.0.1?
============================
Release date: 2023-10-15
* Fix crashes linting code using PEP 695 (Python 3.12) generic type syntax.
Closes pylint-dev/pylint#9098
What's New in astroid 3.0.0?
=============================
Release date: 2023-09-26
* Add support for Python 3.12, including PEP 695 type parameter syntax.
Closes #2201
* Remove support for Python 3.7.
Refs #2137
* Use the global inference cache when inferring, even without an explicit
``InferenceContext``. This is a significant performance improvement given how
often methods default to ``None`` for the context argument. (Linting ``astroid``
itself now takes ~5% less time on Python 3.12; other projects requiring more
complex inference calculations will see greater speedups.)
Refs #529
* Following a deprecation period starting in astroid 2.7.0, the ``astroid.node_classes``
and ``astroid.scoped_nodes`` modules have been removed in favor of ``astroid.nodes.node_classes``
and ``astroid.nodes.scoped_nodes``.
Closes #1072
* Following a deprecation period starting in astroid 2.12.0, the ``astroid.mixins`` module
has been removed in favor of ``astroid.nodes._base_nodes`` (private).
Refs #1633
* Return all existing arguments when calling ``Arguments.arguments()``. This also means ``find_argname`` will now
use the whole list of arguments for its search.
Closes #2213
* Exclude class attributes from the ``__members__`` container of an ``Enum`` class when they are
``nodes.AnnAssign`` nodes with no assigned value.
Refs pylint-dev/pylint#7402
* Remove ``@cached`` and ``@cachedproperty`` decorator (just use ``@cached_property`` from the stdlib).
Closes #1780
Refs #2140
* Remove the ``inference`` module. Node inference methods are now in the module
defining the node, rather than being associated to the node afterward.
Closes #679
* Move ``LookupMixIn`` to ``astroid.nodes._base_nodes`` and make it private.
* Remove the shims for ``OperationError``, ``BinaryOperationError``, and ``UnaryOperationError``
in ``exceptions``. They were moved to ``util`` in astroid 1.5.0.
* Move ``safe_infer()`` from ``helpers`` to ``util``. This avoids some circular imports.
* Reduce file system access in ``ast_from_file()``.
* Reduce time to ``import astroid`` by delaying ``astroid_bootstrapping()`` until
the first instantiation of ``AstroidBuilder``.
Closes #2161
* Make ``igetattr()`` idempotent. This addresses some reports of varying results
when running pylint with ``--jobs``.
Closes pylint-dev/pylint#4356
Refs #7
* Fix incorrect cache keys for inference results, thereby correctly inferring types
for calls instantiating types dynamically.
Closes #1828
Closes pylint-dev/pylint#7464
Closes pylint-dev/pylint#8074
* Fix interrupted ``InferenceContext`` call chains, thereby addressing performance
problems when linting ``sqlalchemy``.
Closes pylint-dev/pylint#8150
* ``nodes.FunctionDef`` no longer inherits from ``nodes.Lambda``.
This is a breaking change but considered a bug fix as the nodes did not share the same
API and were not interchangeable.
We have tried to minimize the amount of breaking changes caused by this change
but some are unavoidable.
* ``infer_call_result`` now shares the same interface across all implementations. Namely:
```python
def infer_call_result(
self,
caller: SuccessfulInferenceResult | None,
context: InferenceContext | None = None,
) -> Iterator[InferenceResult]:
```
This is a breaking change for ``nodes.FunctionDef`` where previously ``caller`` had a default of
``None``. Passing ``None`` again will not create a behaviour change.
The breaking change allows us to better type and re-use the method within ``astroid``.
* Improved signature of the ``__init__`` and ``__postinit__`` methods of most nodes.
This includes making ``lineno``, ``col_offset``, ``end_lineno``, ``end_col_offset`` and ``parent``
required arguments for ``nodes.NodeNG`` and its subclasses.
For most other nodes, arguments of their ``__postinit__`` methods have been made required to better
represent how they would normally be constructed by the standard library ``ast`` module.
The following nodes were changed or updated:
- ``nodes.AnnAssign``
- ``nodes.Arguments``
- ``nodes.Assign``
- ``nodes.AssignAttr``
- ``nodes.AssignName``
- ``nodes.Attribute``
- ``nodes.AugAssign``
- ``nodes.Await``
- ``nodes.BaseContainer``
- ``nodes.BinOp``
- ``nodes.Call``
- ``nodes.ClassDef``
- ``nodes.Compare``
- ``nodes.Comprehension``
- ``nodes.Decorators``
- ``nodes.Delete``
- ``nodes.DelAttr``
- ``nodes.DelName``
- ``nodes.Dict``
- ``nodes.DictComp``
- ``nodes.ExceptHandler``
- ``nodes.Expr``
- ``nodes.For``
- ``nodes.FunctionDef``
- ``nodes.GeneratorExp``
- ``nodes.If``
- ``nodes.IfExp``
- ``nodes.Keyword``
- ``nodes.Lambda``
- ``nodes.ListComp``
- ``nodes.Module``
- ``nodes.Name``
- ``nodes.NodeNG``
- ``nodes.Raise``
- ``nodes.Return``
- ``nodes.SetComp``
- ``nodes.Slice``
- ``nodes.Starred``
- ``objects.Super``, we also added the ``call`` parameter to its ``__init__`` method.
- ``nodes.Subscript``
- ``nodes.UnaryOp``
- ``nodes.While``
- ``nodes.Yield``
These changes involve breaking changes to their API but should be considered bug fixes. We
now make arguments required when they are instead of always providing defaults.
* ``nodes.If.self.is_orelse`` has been removed as it was never set correctly and therefore
provided a false value.
* Remove dependency on ``wrapt``.
* Remove dependency on ``lazy_object_proxy``. This includes the removal
of the associated ``lazy_import``, ``lazy_descriptor`` and ``proxy_alias`` utility functions.
* ``CallSite._unpack_args`` and ``CallSite._unpack_keywords`` now use ``safe_infer()`` for
better inference and fewer false positives.
Closes pylint-dev/pylint#8544
* Add ``attr.Factory`` to the recognized class attributes for classes decorated with ``attrs``.
Closes pylint-dev/pylint#4341
* ``infer_property()`` now observes the same property-specific workaround as ``infer_functiondef``.
Refs #1490
* Remove unused and / or deprecated constants:
- ``astroid.bases.BOOL_SPECIAL_METHOD``
- ``astroid.bases.BUILTINS``
- ``astroid.const.BUILTINS``
- ``astroid.const.PY38_PLUS``
- ``astroid.const.Load``
- ``astroid.const.Store``
- ``astroid.const.Del``
Refs #2141
* ``frame()`` raises ``ParentMissingError`` and ``statement()`` raises ``StatementMissing`` for
missing parents regardless of the value of the ``future`` argument (which gave this behavior
already).
The ``future`` argument to each method is deprecated and will be removed in astroid 4.0.
Refs #1217
* Remove deprecated ``Ellipsis``, ``ExtSlice``, ``Index`` nodes.
Refs #2152
* Remove deprecated ``is_sys_guard`` and ``is_typing_guard`` methods.
Refs #2153
* Remove deprecated ``doc`` attribute for ``Module``, ``ClassDef``, and ``FunctionDef``.
Use the ``doc_node`` attribute instead.
Refs #2154
* Add new ``nodes.Try`` to better match Python AST. Replaces the ``TryExcept``
and ``TryFinally`` nodes which have been removed.
* Publicize ``NodeNG.repr_name()`` to facilitate finding a node's nice name.
Refs pylint-dev/pylint#8598
* Fix false positives for ``no-member`` and ``invalid-name`` when using the ``_name_``, ``_value_`` and ``_ignore_`` sunders in Enums.
Closes pylint-dev/pylint#9015
What's New in astroid 2.15.8?
=============================
Release date: 2023-09-26
* Fix a regression in 2.15.7 for ``unsubscriptable-object``.
Closes #2305
Closes pylint-dev/pylint#9069
* Fix a regression in 2.15.7 for ``unsubscriptable-object``.
Closes #2305
Closes pylint-dev/pylint#9069
What's New in astroid 2.15.7?
=============================
Release date: 2023-09-23
* Fix a crash when inferring a ``typing.TypeVar`` call.
Closes pylint-dev/pylint#8802
* Infer user-defined enum classes by checking if the class is a subtype of ``enum.Enum``.
Closes pylint-dev/pylint#8897
* Fix inference of functions with ``@functools.lru_cache`` decorators without
parentheses.
Closes pylint-dev/pylint#8868
* Make ``sys.argv`` uninferable because it never is. (It's impossible to infer
the value it will have outside of static analysis where it's our own value.)
Refs pylint-dev/pylint#7710
What's New in astroid 2.15.6?
=============================
Release date: 2023-07-08
* Harden ``get_module_part()`` against ``"."``.
Closes pylint-dev/pylint#8749
* Allow ``AsStringVisitor`` to visit ``objects.PartialFunction``.
Closes pylint-dev/pylint#8881
* Avoid expensive list/tuple multiplication operations that would result in ``MemoryError``.
Closes pylint-dev/pylint#8748
* Fix a regression in 2.12.0 where settings in AstroidManager would be ignored.
Most notably this addresses pylint-dev/pylint#7433.
Refs #2204
What's New in astroid 2.15.5?
=============================
Release date: 2023-05-14
* Handle ``objects.Super`` in ``helpers.object_type()``.
Refs pylint-dev/pylint#8554
* Recognize stub ``pyi`` Python files.
Refs pylint-dev/pylint#4987
What's New in astroid 2.15.4?
=============================
Release date: 2023-04-24
* Add visitor function for ``TryStar`` to ``AsStringVisitor`` and
add ``TryStar`` to ``astroid.nodes.ALL_NODE_CLASSES``.
Refs #2142
What's New in astroid 2.15.3?
=============================
Release date: 2023-04-16
* Fix ``infer_call_result()`` crash on methods called ``with_metaclass()``.
Closes #1735
* Suppress ``UserWarning`` when finding module specs.
Closes pylint-dev/pylint#7906
What's New in astroid 2.15.2?
=============================
Release date: 2023-04-03
* Support more possible usages of ``attrs`` decorators.
Closes pylint-dev/pylint#7884
What's New in astroid 2.15.1?
=============================
Release date: 2023-03-26
* Restore behavior of setting a Call as a base for classes created using ``six.with_metaclass()``,
and harden support for using enums as metaclasses in this case.
Reverts #1622
Refs pylint-dev/pylint#5935
Refs pylint-dev/pylint#7506
What's New in astroid 2.15.0?
=============================
Release date: 2023-03-06
* astroid now supports ``TryStar`` nodes from python 3.11 and should be fully compatible with python 3.11.
Closes #2028
* ``Formattedvalue.postinit`` is now keyword only. This is to allow correct typing of the
``Formattedvalue`` class.
Refs #1516
* ``Astroid`` now supports custom import hooks.
Refs pylint-dev/pylint#7306
* ``astroid`` now infers return values from match cases.
Refs pylint-dev/pylint#5288
* ``AstroidManager.clear_cache`` now also clears the inference context cache.
Refs #1780
* ``max_inferable_values`` can now be set on ``AstroidManager`` instances, e.g. ``astroid.MANAGER``
besides just the ``AstroidManager`` class itself.
Closes #2280
* ``Astroid`` now retrieves the default values of keyword only arguments and sets them on
``Arguments.kw_defaults``.
* ``Uninferable`` now has the type ``UninferableBase``. This is to facilitate correctly type annotating
code that uses this singleton.
Closes #1680
* Deprecate ``modutils.is_standard_module()``. It will be removed in the next minor release.
Functionality has been replaced by two new functions,
``modutils.is_stdlib_module()`` and ``modutils.module_in_path()``.
Closes #2012
* Fix ``are_exclusive`` function when a walrus operator is used inside ``IfExp.test`` field.
Closes #2022
What's New in astroid 2.14.2?
=============================
Release date: 2023-02-12
* '_infer_str_format_call' won't crash anymore when the string it analyses are uninferable.
Closes pylint-dev/pylint#8109
What's New in astroid 2.14.1?
=============================
Release date: 2023-01-31
* Revert ``CallContext`` change as it caused a ``RecursionError`` regression.
What's New in astroid 2.14.0?
=============================
Release date: 2023-01-31
* Add support for inferring binary union types added in Python 3.10.
Refs pylint-dev/pylint#8119
* Capture and log messages emitted when inspecting a module for astroid.
Closes #1904
What's New in astroid 2.13.5?
=============================
Release date: 2023-01-31
* Revert ``CallContext`` change as it caused a ``RecursionError`` regression.
What's New in astroid 2.13.4?
=============================
Release date: 2023-01-31
* Fix issues with ``typing_extensions.TypeVar``.
* Fix ``ClassDef.fromlino`` for PyPy 3.8 (v7.3.11) if class is wrapped by a decorator.
* Preserve parent CallContext when inferring nested functions.
Closes pylint-dev/pylint#8074
* Add ``Lock`` to the ``multiprocessing`` brain.
Closes pylint-dev/pylint#3313
What's New in astroid 2.13.3?
=============================
Release date: 2023-01-20
* Fix a regression in 2.13.2 where a RunTimeError could be raised unexpectedly.
Closes #1958
* Fix overwritten attributes in inherited dataclasses not being ordered correctly.
Closes pylint-dev/pylint#7881
* Fix a false positive when an attribute named ``Enum`` was confused with ``enum.Enum``.
Calls to ``Enum`` are now inferred & the qualified name is checked.
Refs pylint-dev/pylint#5719
* Remove unnecessary typing_extensions dependency on Python 3.11 and newer
What's New in astroid 2.13.2?
=============================
Release date: 2023-01-08
* Removed version conditions on typing_extensions dependency. Removed typing_extensions from
our tests requirements as it was preventing issues to appear in our continuous integration.
Closes #1945
What's New in astroid 2.13.1?
=============================
Release date: 2023-01-08
* Bumping typing_extensions to 4.0.0 that is required when using ``Self``
Closes #1942
What's New in astroid 2.13.0?
=============================
Release date: 2023-01-07
* Fixed importing of modules that have the same name as the file that is importing.
``astroid`` will now correctly handle an ``import math`` statement in a file called ``math.py``
by relying on the import system.
Refs pylint-dev/pylint#5151
* Create ``ContextManagerModel`` and let ``GeneratorModel`` inherit from it.
Refs pylint-dev/pylint#2567
* Added a ``regex`` brain.
Refs pylint-dev/pylint#1911
* Support "is None" constraints from if statements during inference.
Ref #791
Ref pylint-dev/pylint#157
Ref pylint-dev/pylint#1472
Ref pylint-dev/pylint#2016
Ref pylint-dev/pylint#2631
Ref pylint-dev/pylint#2880
What's New in astroid 2.12.14?
==============================
Release date: 2023-01-06
* Handle the effect of properties on the ``__init__`` of a dataclass correctly.
Closes pylint-dev/pylint#5225
* Handle the effect of ``kw_only=True`` in dataclass fields correctly.
Closes pylint-dev/pylint#7623
* Handle the effect of ``init=False`` in dataclass fields correctly.
Closes pylint-dev/pylint#7291
* Fix crash if ``numpy`` module doesn't have ``version`` attribute.
Refs pylint-dev/pylint#7868
* Handle ``AttributeError`` during ``str.format`` template inference tip evaluation
Closes pylint-dev/pylint#1902
* Add the ``masked_invalid`` function in the ``numpy.ma`` brain.
Closes pylint-dev/pylint#5715
What's New in astroid 2.12.13?
==============================
Release date: 2022-11-19
* Prevent returning an empty list for ``ClassDef.slots()`` when the mro list contains one class & it is not ``object``.
Refs pylint-dev/pylint#5099
* Prevent a crash when inferring calls to ``str.format`` with inferred arguments
that would be invalid.
Closes #1856
* Infer the `length` argument of the ``random.sample`` function.
Refs pylint-dev/pylint#7706
* Catch ``ValueError`` when indexing some builtin containers and sequences during inference.
Closes #1843
What's New in astroid 2.12.12?
==============================
Release date: 2022-10-19
* Add the ``length`` parameter to ``hash.digest`` & ``hash.hexdigest`` in the ``hashlib`` brain.
Refs pylint-dev/pylint#4039
* Prevent a crash when a module's ``__path__`` attribute is unexpectedly missing.
Refs pylint-dev/pylint#7592
* Fix inferring attributes with empty annotation assignments if parent
class contains valid assignment.
Refs pylint-dev/pylint#7631
What's New in astroid 2.12.11?
==============================
Release date: 2022-10-10
* Add ``_value2member_map_`` member to the ``enum`` brain.
Refs pylint-dev/pylint#3941
* Improve detection of namespace packages for the modules with ``__spec__`` set to None.
Closes pylint-dev/pylint#7488.
* Fixed a regression in the creation of the ``__init__`` of dataclasses with
multiple inheritance.
Closes pylint-dev/pylint#7434
What's New in astroid 2.12.10?
==============================
Release date: 2022-09-17
* Fixed a crash when introspecting modules compiled by `cffi`.
Closes #1776
Closes pylint-dev/pylint#7399
* ``decorators.cached`` now gets its cache cleared by calling ``AstroidManager.clear_cache``.
Refs #1780
What's New in astroid 2.12.9?
=============================
Release date: 2022-09-07
* Fixed creation of the ``__init__`` of ``dataclassess`` with multiple inheritance.
Closes pylint-dev/pylint#7427
* Fixed a crash on ``namedtuples`` that use ``typename`` to specify their name.
Closes pylint-dev/pylint#7429
What's New in astroid 2.12.8?
=============================
Release date: 2022-09-06
* Fixed a crash in the ``dataclass`` brain for ``InitVars`` without subscript typing.
Closes pylint-dev/pylint#7422
* Fixed parsing of default values in ``dataclass`` attributes.
Closes pylint-dev/pylint#7425
What's New in astroid 2.12.7?
=============================
Release date: 2022-09-06
* Fixed a crash in the ``dataclass`` brain for uninferable bases.
Closes pylint-dev/pylint#7418
What's New in astroid 2.12.6?
=============================
Release date: 2022-09-05
* Fix a crash involving ``Uninferable`` arguments to ``namedtuple()``.
Closes pylint-dev/pylint#7375
* The ``dataclass`` brain now understands the ``kw_only`` keyword in dataclass decorators.
Closes pylint-dev/pylint#7290
What's New in astroid 2.12.5?
=============================
Release date: 2022-08-29
* Prevent first-party imports from being resolved to `site-packages`.
Refs pylint-dev/pylint#7365
* Fix ``astroid.interpreter._import.util.is_namespace()`` incorrectly
returning ``True`` for frozen stdlib modules on PyPy.
Closes #1755
What's New in astroid 2.12.4?
=============================
Release date: 2022-08-25
* Fixed a crash involving non-standard type comments such as ``# type: # any comment``.
Refs pylint-dev/pylint#7347
What's New in astroid 2.12.3?
=============================
Release date: 2022-08-23
* Fixed crash in ``ExplicitNamespacePackageFinder`` involving ``_SixMetaPathImporter``.
Closes #1708
* Fix unhandled `FutureWarning` from pandas import in cython modules
Closes #1717
* Fix false positive with inference of type-annotated Enum classes.
Refs pylint-dev/pylint#7265
* Fix crash with inference of type-annotated Enum classes where the member has no value.
* Fix a crash inferring invalid old-style string formatting with `%`.
Closes #1737
* Fix false positive with inference of ``http`` module when iterating ``HTTPStatus``.
Refs pylint-dev/pylint#7307
* Bumped minimum requirement of ``wrapt`` to 1.14 on Python 3.11.
* Don't add dataclass fields annotated with ``KW_ONLY`` to the list of fields.
Refs pylint-dev/pylint#5767
What's New in astroid 2.12.2?
=============================
Release date: 2022-07-12
* Fixed crash in modulo operations for divisions by zero.
Closes #1700
* Fixed crash with recursion limits during inference.
Closes #1646
What's New in astroid 2.12.1?
=============================
Release date: 2022-07-10
* Fix a crash when inferring old-style string formatting (``%``) using tuples.
* Fix a crash when ``None`` (or a value inferred as ``None``) participates in a
``**`` expression.
* Fix a crash involving properties within ``if`` blocks.
What's New in astroid 2.12.0?
=============================
Release date: 2022-07-09
* Fix signal has no ``connect`` member for PySide2 5.15.2+ and PySide6
Closes #4040, #5378
* ``astroid`` now requires Python 3.7.2 to run.
* Avoid setting a Call as a base for classes created using ``six.with_metaclass()``.
Refs pylint-dev/pylint#5935
* Fix detection of builtins on ``PyPy`` 3.9.
* Fix ``re`` brain on Python ``3.11``. The flags now come from ``re._compile``.
* Build ``nodes.Module`` for frozen modules which have location information in their
``ModuleSpec``.
Closes #1512
* The ``astroid.mixins`` module has been deprecated and marked for removal in 3.0.0.
Closes #1633
* Capture and log messages emitted by C extensions when importing them.
This prevents contaminating programmatic output, e.g. pylint's JSON reporter.
Closes pylint-dev/pylint#3518
* Calls to ``str.format`` are now correctly inferred.
Closes #104, Closes #1611
* ``__new__`` and ``__init__`` have been added to the ``ObjectModel`` and are now
inferred as ``BoundMethods``.
* Old style string formatting (using ``%`` operators) is now correctly inferred.
Closes #151
* Adds missing enums from ``ssl`` module.
Closes pylint-dev/pylint#3691
* Remove dependency on ``pkg_resources`` from ``setuptools``.
Closes #1103
* Allowed ``AstroidManager.clear_cache`` to reload necessary brain plugins.
* Fixed incorrect inferences after rebuilding the builtins module, e.g. by calling
``AstroidManager.clear_cache``.
Closes #1559
* ``Arguments.defaults`` is now ``None`` for uninferable signatures.
* On Python versions >= 3.9, ``astroid`` now understands subscripting
builtin classes such as ``enumerate`` or ``staticmethod``.
* Fixed inference of ``Enums`` when they are imported under an alias.
Closes pylint-dev/pylint#5776
* Rename ``ModuleSpec`` -> ``module_type`` constructor parameter to match attribute
name and improve typing. Use ``type`` instead.
* ``ObjectModel`` and ``ClassModel`` now know about their ``__new__`` and ``__call__`` attributes.
* Fixed pylint ``not-callable`` false positive with nested-tuple assignment in a for-loop.
Refs pylint-dev/pylint#5113
* Instances of builtins created with ``__new__(cls, value)`` are now inferred.
* Infer the return value of the ``.copy()`` method on ``dict``, ``list``, ``set``,
and ``frozenset``.
Closes #1403
* Fixed inference of elements of living container objects such as tuples and sets in the
``sys`` and ``ssl`` modules.
* Add ``pathlib`` brain to handle ``pathlib.PurePath.parents`` inference.
Closes pylint-dev/pylint#5783
* Avoid inferring the results of ``**`` operations involving values greater than ``1e5``
to avoid expensive computation.
Closes pylint-dev/pylint#6745
* Fix test for Python ``3.11``. In some instances ``err.__traceback__`` will
be uninferable now.
* Add brain for numpy core module ``einsumfunc``.
Closes pylint-dev/pylint#5821
* Infer the ``DictUnpack`` value for ``Dict.getitem`` calls.
Closes #1195
* Fix a crash involving properties within ``try ... except`` blocks.
Closes pylint-dev/pylint#6592
* Prevent creating ``Instance`` objects that proxy other ``Instance``s when there is
ambiguity (or user error) in calling ``__new__(cls)``.
Refs pylint-dev/pylint#7109
What's New in astroid 2.11.7?
=============================
Release date: 2022-07-09
* Added support for ``usedforsecurity`` keyword to ``hashlib`` constructors.
Closes pylint-dev/pylint#6017
* Updated the stdlib brain for ``subprocess.Popen`` to accommodate Python 3.9+.
Closes pylint-dev/pylint#7092
What's New in astroid 2.11.6?
=============================
Release date: 2022-06-13
* The Qt brain now correctly treats calling ``.disconnect()`` (with no
arguments) on a slot as valid.
* The argparse brain no longer incorrectly adds ``"Namespace"`` to the locals
of functions that return an ``argparse.Namespace`` object.
Refs pylint-dev/pylint#6895
What's New in astroid 2.11.5?
=============================
Release date: 2022-05-09
* Fix crash while obtaining ``object_type()`` of an ``Unknown`` node.
Refs pylint-dev/pylint#6539
* Fix a bug where in attempting to handle the patching of ``distutils`` by ``virtualenv``,
library submodules called ``distutils`` (e.g. ``numpy.distutils``) were included also.
Refs pylint-dev/pylint#6497
What's New in astroid 2.11.4?
=============================
Release date: 2022-05-02
* Fix ``col_offset`` attribute for nodes involving ``with`` on ``PyPy``.
* Fixed a crash involving two starred expressions: one inside a comprehension,
both inside a call.
Refs pylint-dev/pylint#6372
* Made ``FunctionDef.implicit_parameters`` return 1 for methods by making
``FunctionDef.is_bound`` return ``True``, as it does for class methods.
Closes pylint-dev/pylint#6464
* Fixed a crash when ``_filter_stmts`` encounters an ``EmptyNode``.
Closes pylint-dev/pylint#6438
What's New in astroid 2.11.3?
=============================
Release date: 2022-04-19
* Fixed an error in the Qt brain when building ``instance_attrs``.
Closes pylint-dev/pylint#6221
* Fixed a crash in the ``gi`` brain.
Closes pylint-dev/pylint#6371
What's New in astroid 2.11.2?
=============================
Release date: 2022-03-26
* Avoided adding the name of a parent namedtuple to its child's locals.
Refs pylint-dev/pylint#5982
What's New in astroid 2.11.1?
=============================
Release date: 2022-03-22
* Promoted ``getattr()`` from ``astroid.scoped_nodes.FunctionDef`` to its parent
``astroid.scoped_nodes.Lambda``.
* Fixed crash on direct inference via ``nodes.FunctionDef._infer``.
Closes #817
What's New in astroid 2.11.0?
=============================
Release date: 2022-03-12
* Add new (optional) ``doc_node`` attribute to ``nodes.Module``, ``nodes.ClassDef``,
and ``nodes.FunctionDef``.
* Accessing the ``doc`` attribute of ``nodes.Module``, ``nodes.ClassDef``, and
``nodes.FunctionDef`` has been deprecated in favour of the ``doc_node`` attribute.
Note: ``doc_node`` is an (optional) ``nodes.Const`` whereas ``doc`` was an (optional) ``str``.
* Passing the ``doc`` argument to the ``__init__`` of ``nodes.Module``, ``nodes.ClassDef``,
and ``nodes.FunctionDef`` has been deprecated in favour of the ``postinit`` ``doc_node`` attribute.
Note: ``doc_node`` is an (optional) ``nodes.Const`` whereas ``doc`` was an (optional) ``str``.
* Replace custom ``cachedproperty`` with ``functools.cached_property`` and deprecate it
for Python 3.8+.
Closes #1410
* Set ``end_lineno`` and ``end_col_offset`` attributes to ``None`` for all nodes
with PyPy 3.8. PyPy 3.8 assigns these attributes inconsistently which could lead
to unexpected errors. Overwriting them with ``None`` will cause a fallback
to the already supported way of PyPy 3.7.
* Add missing ``shape`` parameter to numpy ``zeros_like``, ``ones_like``,
and ``full_like`` methods.
Closes pylint-dev/pylint#5871
* Only pin ``wrapt`` on the major version.
What's New in astroid 2.10.0?
=============================
Release date: 2022-02-27
* Fixed inference of ``self`` in binary operations in which ``self``
is part of a list or tuple.
Closes pylint-dev/pylint#4826
* Fixed builtin inference on `property` calls not calling the `postinit` of the new node, which
resulted in instance arguments missing on these nodes.
* Fixed a crash on ``Super.getattr`` when the attribute was previously uninferable due to a cache
limit size. This limit can be hit when the inheritance pattern of a class (and therefore of the
``__init__`` attribute) is very large.
Closes pylint-dev/pylint#5679
* Include names of keyword-only arguments in ``astroid.scoped_nodes.Lambda.argnames``.
Closes pylint-dev/pylint#5771
* Fixed a crash inferring on a ``NewType`` named with an f-string.
Closes pylint-dev/pylint#5770
* Add support for [attrs v21.3.0](https://github.com/python-attrs/attrs/releases/tag/21.3.0) which
added a new `attrs` module alongside the existing `attr`.
Closes #1330
* Use the ``end_lineno`` attribute for the ``NodeNG.tolineno`` property
when it is available.
Closes #1350
* Add ``is_dataclass`` attribute to ``ClassDef`` nodes.
* Use ``sysconfig`` instead of ``distutils`` to determine the location of
python stdlib files and packages.
Related pull requests: #1322, #1323, #1324
Closes #1282
Ref #1103
* Fixed crash with recursion error for inference of class attributes that referenced
the class itself.
Closes pylint-dev/pylint#5408
* Fixed crash when trying to infer ``items()`` on the ``__dict__``
attribute of an imported module.
Closes #1085
* Add optional ``NodeNG.position`` attribute.
Used for block nodes to highlight position of keyword(s) and name
in cases where the AST doesn't provide good enough positional information.
E.g. ``nodes.ClassDef``, ``nodes.FunctionDef``.
* Fix ``ClassDef.fromlineno``. For Python < 3.8 the ``lineno`` attribute includes decorators.
``fromlineno`` should return the line of the ``class`` statement itself.
* Performance improvements. Only run expensive decorator functions when
non-default Deprecation warnings are enabled, eg. during a Pytest run.
Closes #1383
What's New in astroid 2.9.3?
============================
Release date: 2022-01-09
* Fixed regression where packages without a ``__init__.py`` file were
not recognized or imported correctly.
Closes #1327
What's New in astroid 2.9.2?
============================
Release date: 2022-01-04
* Fixed regression in ``astroid.scoped_nodes`` where ``_is_metaclass``
was not accessible anymore.
Closes #1325
What's New in astroid 2.9.1?
============================
Release date: 2021-12-31
* ``NodeNG.frame()`` and ``NodeNG.statement()`` will start raising ``ParentMissingError``
instead of ``AttributeError`` in astroid 3.0. This behaviour can already be triggered
by passing ``future=True`` to a ``frame()`` or ``statement()`` call.
* Prefer the module loader get_source() method in AstroidBuilder's
module_build() when possible to avoid assumptions about source
code being available on a filesystem. Otherwise the source cannot
be found and application behavior changes when running within an
embedded hermetic interpreter environment (pyoxidizer, etc.).
* Require Python 3.6.2 to use astroid.
* Removed custom ``distutils`` handling for resolving paths to submodules.
Ref #1321
* Restore custom ``distutils`` handling for resolving paths to submodules.
Closes pylint-dev/pylint#5645
* Fix ``deque.insert()`` signature in ``collections`` brain.
Closes #1260
* Fix ``Module`` nodes not having a ``col_offset``, ``end_lineno``, and ``end_col_offset``
attributes.
* Fix typing and update explanation for ``Arguments.args`` being ``None``.
* Fix crash if a variable named ``type`` is accessed with an index operator (``[]``)
in a generator expression.
Closes pylint-dev/pylint#5461
* Enable inference of dataclass import from marshmallow_dataclass.
This allows the dataclasses brain to recognize dataclasses annotated by marshmallow_dataclass.
* Resolve symlinks in the import path
Fixes inference error when the import path includes symlinks (e.g. Python
installed on macOS via Homebrew).
Closes #823
Closes pylint-dev/pylint#3499
Closes pylint-dev/pylint#4302
Closes pylint-dev/pylint#4798
Closes pylint-dev/pylint#5081
What's New in astroid 2.9.0?
============================
Release date: 2021-11-21
* Add ``end_lineno`` and ``end_col_offset`` attributes to astroid nodes.
* Always treat ``__class_getitem__`` as a classmethod.
* Add missing ``as_string`` visitor method for ``Unknown`` node.
Closes #1264
What's New in astroid 2.8.6?
============================
Release date: 2021-11-21
* Fix crash on inference of subclasses created from ``Class().__subclasses__``
Closes pylint-dev/pylint#4982
* Fix bug with Python 3.7.0 / 3.7.1 and ``typing.NoReturn``.
Closes #1239
What's New in astroid 2.8.5?
============================
Release date: 2021-11-12
* Use more permissive versions for the ``typed-ast`` dependency (<2.0 instead of <1.5)
Closes #1237
* Fix crash on inference of ``__len__``.
Closes pylint-dev/pylint#5244
* Added missing ``kind`` (for ``Const``) and ``conversion`` (for ``FormattedValue``) fields to repr.
* Fix crash with assignment expressions, nested if expressions and filtering of statements
Closes pylint-dev/pylint#5178
* Fix incorrect filtering of assignment expressions statements
What's New in astroid 2.8.4?
============================
Release date: 2021-10-25
* Fix the ``scope()`` and ``frame()`` methods of ``NamedExpr`` nodes.
When these nodes occur in ``Arguments``, ``Keyword`` or ``Comprehension`` nodes these
methods now correctly point to the outer-scope of the ``FunctionDef``,
``ClassDef``, or ``Comprehension``.
* Fix the ``set_local`` function for ``NamedExpr`` nodes.
When these nodes occur in ``Arguments``, ``Keyword``, or ``Comprehension`` nodes these
nodes are now correctly added to the locals of the ``FunctionDef``,
``ClassDef``, or ``Comprehension``.
What's New in astroid 2.8.3?
============================
Release date: 2021-10-17
* Add support for wrapt 1.13
* Fixes handling of nested partial functions
Closes pylint-dev/pylint#2462
Closes #1208
* Fix regression with the import resolver
Closes pylint-dev/pylint#5131
* Fix crash with invalid dataclass field call
Closes pylint-dev/pylint#5153
What's New in astroid 2.8.2?
============================
Release date: 2021-10-07
Same content than 2.8.2-dev0 / 2.8.1, released in order to fix a
mistake when creating the tag.
What's New in astroid 2.8.1?
============================
Release date: 2021-10-06
* Adds support of type hints inside numpy's brains.
Closes pylint-dev/pylint#4326
* Enable inference of dataclass import from pydantic.dataclasses.
This allows the dataclasses brain to recognize pydantic dataclasses.
Closes pylint-dev/pylint#4899
* Fix regression on ClassDef inference
Closes pylint-dev/pylint#5030
Closes pylint-dev/pylint#5036
* Fix regression on Compare node inference
Closes pylint-dev/pylint#5048
* Extended attrs brain to support the provisional APIs
* Astroid does not trigger it's own deprecation warning anymore.
* Improve brain for ``typing.Callable`` and ``typing.Type``.
* Fix bug with importing namespace packages with relative imports
Closes pylint-dev/pylint#5059
* The ``is_typing_guard`` and ``is_sys_guard`` functions are deprecated and will
be removed in 3.0.0. They are complex meta-inference functions that are better
suited for pylint. Import them from ``pylint.checkers.utils`` instead
(requires pylint ``2.12``).
* Suppress the conditional between applied brains and dynamic import authorized
modules. (Revert the "The transforms related to a module are applied only if this
module has not been explicitly authorized to be imported" of version 2.7.3)
* Adds a brain to infer the ``numpy.ma.masked_where`` function.
Closes pylint-dev/pylint#3342
What's New in astroid 2.8.0?
============================
Release date: 2021-09-14
* Add additional deprecation warnings in preparation for astroid 3.0
* Require attributes for some node classes with ``__init__`` call.
* ``name`` (``str``) for ``Name``, ``AssignName``, ``DelName``
* ``attrname`` (``str``) for ``Attribute``, ``AssignAttr``, ``DelAttr``
* ``op`` (``str``) for ``AugAssign``, ``BinOp``, ``BoolOp``, ``UnaryOp``
* ``names`` (``list[tuple[str, str | None]]``) for ``Import``
* Support pyz imports
Closes pylint-dev/pylint#3887
* Add ``node_ancestors`` method to ``NodeNG`` for obtaining the ancestors of nodes.
* It's now possible to infer the value of comparison nodes
Closes #846
* Fixed bug in inference of dataclass field calls.
Closes pylint-dev/pylint#4963
What's New in astroid 2.7.3?
============================
Release date: 2021-08-30
* The transforms related to a module are applied only if this module has not been explicitly authorized to be imported
(i.e is not in AstroidManager.extension_package_whitelist). Solves the following issues if numpy is authorized to be imported
through the `extension-pkg-allow-list` option.
Closes pylint-dev/pylint#3342
Closes pylint-dev/pylint#4326
* Fixed bug in attribute inference from inside method calls.
Closes pylint-dev/pylint#400
* Fixed bug in inference for superclass instance methods called
from the class rather than an instance.
Closes #1008
Closes pylint-dev/pylint#4377
* Fixed bug in inference of chained attributes where a subclass
had an attribute that was an instance of its superclass.
Closes pylint-dev/pylint#4220
* Adds a brain for the ctypes module.
Closes pylint-dev/pylint#4896
* When processing dataclass attributes, exclude the same type hints from abc.collections
as from typing.
Closes pylint-dev/pylint#4895
* Apply dataclass inference to pydantic's dataclasses.
Closes pylint-dev/pylint#4899
What's New in astroid 2.7.2?
============================
Release date: 2021-08-20
* ``BaseContainer`` is now public, and will replace ``_BaseContainer`` completely in astroid 3.0.
* The call cache used by inference functions produced by ``inference_tip``
can now be cleared via ``clear_inference_tip_cache``.
* ``astroid.const.BUILTINS`` and ``astroid.bases.BUILTINS`` are not used internally anymore
and will be removed in astroid 3.0. Simply replace this by the string 'builtins' for better
performances and clarity.
* Add inference for dataclass initializer method.
Closes pylint-dev/pylint#3201
What's New in astroid 2.7.1?
============================
Release date: 2021-08-16
* When processing dataclass attributes, only do typing inference on collection types.
Support for instantiating other typing types is left for the future, if desired.
Closes #1129
* Fixed LookupMixIn missing from ``astroid.node_classes``.
What's New in astroid 2.7.0?
============================
Release date: 2021-08-15
* Import from ``astroid.node_classes`` and ``astroid.scoped_nodes`` has been deprecated in favor of
``astroid.nodes``. Only the imports from ``astroid.nodes`` will work in astroid 3.0.0.
* Add support for arbitrary Enum subclass hierarchies
Closes pylint-dev/pylint#533
Closes pylint-dev/pylint#2224
Closes pylint-dev/pylint#2626
* Add inference tips for dataclass attributes, including dataclasses.field calls.
Also add support for InitVar.
Closes pylint-dev/pylint#2600
Closes pylint-dev/pylint#2698
Closes pylint-dev/pylint#3405
Closes pylint-dev/pylint#3794
* Adds a brain that deals with dynamic import of `IsolatedAsyncioTestCase` class of the `unittest` module.
Closes pylint-dev/pylint#4060
What's New in astroid 2.6.6?
============================
Release date: 2021-08-03
* Added support to infer return type of ``typing.cast()``
* Fix variable lookup handling of exclusive statements
Closes pylint-dev/pylint#3711
* Fix variable lookup handling of function parameters
Closes pylint-dev/astroid#180
* Fix variable lookup's handling of except clause variables
* Fix handling of classes with duplicated bases with the same name
Closes pylint-dev/astroid#1088
What's New in astroid 2.6.5?
============================
Release date: 2021-07-21
* Fix a crash when there would be a 'TypeError object does not support
item assignment' in the code we parse.
Closes pylint-dev/pylint#4439
* Fix a crash when a AttributeInferenceError was raised when
failing to find the real name in infer_import_from.
Closes pylint-dev/pylint#4692
What's New in astroid 2.6.4?
============================
Release date: 2021-07-19
* Fix a crash when a StopIteration was raised when inferring
a faulty function in a context manager.
Closes pylint-dev/pylint#4723
What's New in astroid 2.6.3?
============================
Release date: 2021-07-19
* Added ``If.is_sys_guard`` and ``If.is_typing_guard`` helper methods
* Fix a bad inference type for yield values inside of a derived class.
Closes pylint-dev/astroid#1090
* Fix a crash when the node is a 'Module' in the brain builtin inference
Closes pylint-dev/pylint#4671
* Fix issues when inferring match variables
Closes pylint-dev/pylint#4685
* Fix lookup for nested non-function scopes
* Fix issue that ``TypedDict`` instance wasn't callable.
Closes pylint-dev/pylint#4715
* Add dependency on setuptools and a guard to prevent related exceptions.
What's New in astroid 2.6.2?
============================
Release date: 2021-06-30
* Fix a crash when the inference of the length of a node failed
Closes pylint-dev/pylint#4633
* Fix unhandled StopIteration during inference, following the implementation
of PEP479 in python 3.7+
Closes pylint-dev/pylint#4631
Closes #1080
What's New in astroid 2.6.1?
============================
Release date: 2021-06-29
* Fix issue with ``TypedDict`` for Python 3.9+
Closes pylint-dev/pylint#4610
What's New in astroid 2.6.0?
============================
Release date: 2021-06-22
* Appveyor and travis are no longer used in the continuous integration
* ``setuptools_scm`` has been removed and replaced by ``tbump`` in order to not
have hidden runtime dependencies to setuptools
* ``NodeNg``, the base node class, is now accessible from ``astroid`` or
``astroid.nodes`` as it can be used for typing.
* Update enum brain to improve inference of .name and .value dynamic class
attributes
Closes pylint-dev/pylint#1932
Closes pylint-dev/pylint#2062
Closes pylint-dev/pylint#2306
* Removed ``Repr``, ``Exec``, and ``Print`` nodes as the ``ast`` nodes
they represented have been removed with the change to Python 3
* Deprecate ``Ellipsis`` node. It will be removed with the next minor release.
Checkers that already support Python 3.8+ work without issues. It's only
necessary to remove all references to the ``astroid.Ellipsis`` node.
This changes will make development of checkers easier as the resulting tree for Ellipsis
will no longer depend on the python version. **Background**: With Python 3.8 the
``ast.Ellipsis`` node, along with ``ast.Str``, ``ast.Bytes``, ``ast.Num``,
and ``ast.NamedConstant`` were merged into ``ast.Constant``.
* Deprecated ``Index`` and ``ExtSlice`` nodes. They will be removed with the
next minor release. Both are now part of the ``Subscript`` node.
Checkers that already support Python 3.9+ work without issues.
It's only necessary to remove all references to the ``astroid.Index`` and
``astroid.ExtSlice`` nodes. This change will make development of checkers
easier as the resulting tree for ``ast.Subscript`` nodes will no longer
depend on the python version. **Background**: With Python 3.9 ``ast.Index``
and ``ast.ExtSlice`` were merged into the ``ast.Subscript`` node.
* Updated all Match nodes to be internally consistent.
* Add ``Pattern`` base class.
What's New in astroid 2.5.8?
============================
Release date: 2021-06-07
* Improve support for Pattern Matching
* Add lineno and col_offset for ``Keyword`` nodes and Python 3.9+
* Add global inference cache to speed up inference of long statement blocks
* Add a limit to the total number of nodes inferred indirectly as a result
of inferring some node
What's New in astroid 2.5.7?
============================
Release date: 2021-05-09
* Fix six.with_metaclass transformation so it doesn't break user defined transformations.
* Fix detection of relative imports.
Closes #930
Closes pylint-dev/pylint#4186
* Fix inference of instance attributes defined in base classes
Closes #932
* Update `infer_named_tuple` brain to reject namedtuple definitions
that would raise ValueError
Closes #920
* Do not set instance attributes on builtin object()
Closes #945
Closes pylint-dev/pylint#4232
Closes pylint-dev/pylint#4221
Closes pylint-dev/pylint#3970
Closes pylint-dev/pylint#3595
* Fix some spurious cycles detected in ``context.path`` leading to more cases
that can now be inferred
Closes #926
* Add ``kind`` field to ``Const`` nodes, matching the structure of the built-in ast Const.
The kind field is "u" if the literal is a u-prefixed string, and ``None`` otherwise.
Closes #898
* Fix property inference in class contexts for properties defined on the metaclass
Closes #940
* Update enum brain to fix definition of __members__ for subclass-defined Enums
Closes pylint-dev/pylint#3535
Closes pylint-dev/pylint#4358
* Update random brain to fix a crash with inference of some sequence elements
Closes #922
* Fix inference of attributes defined in a base class that is an inner class
Closes #904
* Allow inferring a return value of None for non-abstract empty functions and
functions with no return statements (implicitly returning None)
Closes #485
* scm_setuptools has been added to the packaging.
* Astroid's tags are now the standard form ``vX.Y.Z`` and not ``astroid-X.Y.Z`` anymore.
* Add initial support for Pattern Matching in Python 3.10
What's New in astroid 2.5.6?
============================
Release date: 2021-04-25
* Fix retro-compatibility issues with old version of pylint
Closes pylint-dev/pylint#4402
What's New in astroid 2.5.5?
============================
Release date: 2021-04-24
* Fixes the discord link in the project urls of the package.
Closes pylint-dev/pylint#4393
What's New in astroid 2.5.4?
============================
Release date: 2021-04-24
* The packaging is now done via setuptools exclusively. ``doc``, ``tests``, and ``Changelog`` are
not packaged anymore - reducing the size of the package greatly.
* Debian packaging is now (officially) done in https://salsa.debian.org/python-team/packages/astroid.
* ``__pkginfo__`` now only contain ``__version__`` (also accessible with ``astroid.__version__``),
other meta-information are still accessible with ``import importlib;metadata.metadata('astroid')``.
* Added inference tip for ``typing.Tuple`` alias
* Fix crash when evaluating ``typing.NamedTuple``
Closes pylint-dev/pylint#4383
* COPYING was removed in favor of COPYING.LESSER and the latter was renamed to LICENSE to make more apparent
that the code is licensed under LGPLv2 or later.
* Moved from appveyor and travis to Github Actions for continuous integration.
What's New in astroid 2.5.3?
============================
Release date: 2021-04-10
* Takes into account the fact that subscript inferring for a ClassDef may involve __class_getitem__ method
* Reworks the ``collections`` and ``typing`` brain so that pylint`s acceptance tests are fine.
Closes pylint-dev/pylint#4206
* Use ``inference_tip`` for ``typing.TypedDict`` brain.
* Fix mro for classes that inherit from typing.Generic
* Add inference tip for typing.Generic and typing.Annotated with ``__class_getitem__``
Closes pylint-dev/pylint#2822
What's New in astroid 2.5.2?
============================
Release date: 2021-03-28
* Detects `import numpy` as a valid `numpy` import.
Closes pylint-dev/pylint#3974
* Iterate over ``Keywords`` when using ``ClassDef.get_children``
Closes pylint-dev/pylint#3202
What's New in astroid 2.5.1?
============================
Release date: 2021-02-28
* The ``context.path`` is reverted to a set because otherwise it leads to false positives
for non `numpy` functions.
Closes #895 #899
* Don't transform dataclass ClassVars
* Improve typing.TypedDict inference
* Fix the `Duplicates found in MROs` false positive.
Closes #905
Closes pylint-dev/pylint#2717
Closes pylint-dev/pylint#3247
Closes pylint-dev/pylint#4093
Closes pylint-dev/pylint#4131
Closes pylint-dev/pylint#4145
What's New in astroid 2.5?
============================
Release date: 2021-02-15
* Adds `attr_fset` in the `PropertyModel` class.
Fixes pylint-dev/pylint#3480
* Remove support for Python 3.5.
* Remove the runtime dependency on ``six``. The ``six`` brain remains in
astroid.
Fixes pylint-dev/astroid#863
* Enrich the ``brain_collection`` module so that ``__class_getitem__`` method is added to `deque` for
``python`` version above 3.9.
* The ``context.path`` is now a ``dict`` and the ``context.push`` method
returns ``True`` if the node has been visited a certain amount of times.
Close #669
* Adds a brain for type object so that it is possible to write `type[int]` in annotation.
Fixes pylint-dev/pylint#4001
* Add ``__class_getitem__`` method to ``subprocess.Popen`` brain under Python 3.9 so that it is seen as subscriptable by pylint.
Fixes pylint-dev/pylint#4034
* Adds `degrees`, `radians`, which are `numpy ufunc` functions, in the `numpy` brain. Adds `random` function in the `numpy.random` brain.
Fixes pylint-dev/pylint#3856
* Fix deprecated importlib methods
Closes #703
* Fix a crash in inference caused by `Uninferable` container elements
Close #866
* Add `python 3.9` support.
* The flat attribute of ``numpy.ndarray`` is now inferred as an ``numpy.ndarray`` itself.
It should be a ``numpy.flatiter`` instance, but this class is not yet available in the numpy brain.
Fixes pylint-dev/pylint#3640
* Fix a bug for dunder methods inference of function objects
Fixes #819
* Fixes a bug in the signature of the ``ndarray.__or__`` method,
in the ``brain_numpy_ndarray.py`` module.
Fixes #815
* Fixes a to-list cast bug in ``starred_assigned_stmts`` method, in the
``protocols.py`` module.
* Added a brain for ``hypothesis.strategies.composite``
* The transpose of a ``numpy.ndarray`` is also a ``numpy.ndarray``
Fixes pylint-dev/pylint#3387
* Added a brain for ``sqlalchemy.orm.session``
* Separate string and bytes classes patching
Fixes pylint-dev/pylint#3599
* Prevent recursion error for self referential length calls
Close #777
* Added missing methods to the brain for ``mechanize``, to fix pylint false positives
Close #793
* Added more supported parameters to ``subprocess.check_output``
* Fix recursion errors with pandas
Fixes pylint-dev/pylint#2843
Fixes pylint-dev/pylint#2811
* Added exception inference for `UnicodeDecodeError`
Close pylint-dev/pylint#3639
* `FunctionDef.is_generator` properly handles `yield` nodes in `If` tests
Close pylint-dev/pylint#3583
* Fixed exception-chaining error messages.
* Fix failure to infer base class type with multiple inheritance and qualified names
Fixes #843
* Fix interpretation of ``six.with_metaclass`` class definitions.
Fixes #713
* Reduce memory usage of astroid's module cache.
* Remove dependency on `imp`.
Close #594
Close #681
* Do not crash when encountering starred assignments in enums.
Close #835
* Fix a crash in functools.partial inference when the arguments cannot be determined
Close pylint-dev/pylint#3776
* Fix a crash caused by a lookup of a monkey-patched method
Close pylint-dev/pylint#3686
* ``is_generator`` correctly considers `Yield` nodes in `AugAssign` nodes
This fixes a false positive with the `assignment-from-no-return` pylint check.
Close pylint-dev/pylint#3904
* Corrected the parent of function type comment nodes.
These nodes used to be parented to their original ast.FunctionDef parent
but are now correctly parented to their astroid.FunctionDef parent.
Close pylint-dev/astroid#851
What's New in astroid 2.4.2?
============================
Release date: 2020-06-08
* `FunctionDef.is_generator` properly handles `yield` nodes in `While` tests
Close pylint-dev/pylint#3519
* Properly construct the arguments of inferred property descriptors
Close pylint-dev/pylint#3648
What's New in astroid 2.4.1?
============================
Release date: 2020-05-05
* Handle the case where the raw builder fails to retrieve the ``__all__`` attribute
Close #772
* Restructure the AST parsing heuristic to always pick the same module
Close pylint-dev/pylint#3540
Close #773
* Changed setup.py to work with [distlib](https://pypi.org/project/distlib)
Close #779
* Do not crash with SyntaxError when parsing namedtuples with invalid label
Close pylint-dev/pylint#3549
* Protect against ``infer_call_result`` failing with `InferenceError` in `Super.getattr()`
Close pylint-dev/pylint#3529
What's New in astroid 2.4.0?
============================
Release date: 2020-04-27
* Expose a ast_from_string method in AstroidManager, which will accept
source code as a string and return the corresponding astroid object
Closes pylint-dev/astroid#725
* ``BoundMethod.implicit_parameters`` returns a proper value for ``__new__``
Close pylint-dev/pylint#2335
* Allow slots added dynamically to a class to still be inferred
Close pylint-dev/pylint#2334
* Allow `FunctionDef.getattr` to look into both instance attrs and special attributes
Close pylint-dev/pylint#1078
* Infer qualified ``classmethod`` as a classmethod.
Close pylint-dev/pylint#3417
* Prevent a recursion error to happen when inferring the declared metaclass of a class
Close #749
* Raise ``AttributeInferenceError`` when ``getattr()`` receives an empty name
Close pylint-dev/pylint#2991
* Prevent a recursion error for self reference variables and `type()` calls.
Close #199
* Do not infer the first argument of a staticmethod in a metaclass as the class itself
Close pylint-dev/pylint#3032
* ``NodeNG.bool_value()`` gained an optional ``context`` parameter
We need to pass an inference context downstream when inferring the boolean
value of a node in order to prevent recursion errors and double inference.
This fix prevents a recursion error with dask library.
Close pylint-dev/pylint#2985
* Pass a context argument to ``astroid.Arguments`` to prevent recursion errors
Close pylint-dev/pylint#3414
* Better inference of class and static methods decorated with custom methods
Close pylint-dev/pylint#3209
* Reverse the order of decorators for `infer_subscript`
`path_wrapper` needs to come first, followed by `raise_if_nothing_inferred`,
otherwise we won't handle `StopIteration` correctly.
Close #762
* Prevent a recursion error when inferring self-referential variables without definition
Close pylint-dev/pylint#1285
* Numpy `datetime64.astype` return value is inferred as a `ndarray`.
Close pylint-dev/pylint#3332
* Skip non ``Assign`` and ``AnnAssign`` nodes from enum reinterpretation
Closes pylint-dev/pylint#3365
* Numpy ``ndarray`` attributes ``imag`` and ``real`` are now inferred as ``ndarray``.
Close pylint-dev/pylint#3322
* Added a call to ``register_transform`` for all functions of the ``brain_numpy_core_multiarray``
module in case the current node is an instance of ``astroid.Name``
Close #666
* Use the parent of the node when inferring aug assign nodes instead of the statement
Close pylint-dev/pylint#2911
Close pylint-dev/pylint#3214
* Added some functions to the ``brain_numpy_core_umath`` module
Close pylint-dev/pylint#3319
* Added some functions of the ``numpy.core.multiarray`` module
Close pylint-dev/pylint#3208
* All the ``numpy ufunc`` functions derived now from a common class that
implements the specific ``reduce``, ``accumulate``, ``reduceat``,
``outer`` and ``at`` methods.
Close pylint-dev/pylint#2885
* ``nodes.Const.itered`` returns a list of ``Const`` nodes, not strings
Close pylint-dev/pylint#3306
* The ``shape`` attribute of a ``numpy ndarray`` is now a ``ndarray``
Close pylint-dev/pylint#3139
* Don't ignore special methods when inspecting gi classes
Close #728
* Added transform for ``scipy.gaussian``
* Add support for inferring properties.
* Added a brain for ``responses``
* Allow inferring positional only arguments.
* Retry parsing a module that has invalid type comments
It is possible for a module to use comments that might be interpreted
as type comments by the `ast` library. We do not want to completely crash on those
invalid type comments.
Close #708
* Scope the inference to the current bound node when inferring instances of classes
When inferring instances of classes from arguments, such as ``self``
in a bound method, we could use as a hint the context's ``boundnode``,
which indicates the instance from which the inference originated.
As an example, a subclass that uses a parent's method which returns
``self``, will override the ``self`` to point to it instead of pointing
to the parent class.
Close pylint-dev/pylint#3157
* Add support for inferring exception instances in all contexts
We were able to infer exception instances as ``ExceptionInstance``
only for a handful of cases, but not all. ``ExceptionInstance`` has
support for better inference of `.args` and other exception related
attributes that normal instances do not have.
This additional support should remove certain false positives related
to ``.args`` and other exception attributes in ``pylint``.
Close pylint-dev/pylint#2333
* Add more supported parameters to ``subprocess.check_output``
Close #722
* Infer args unpacking of ``self``
Certain stdlib modules use ``*args`` to encapsulate
the ``self`` parameter, which results in uninferable
instances given we rely on the presence of the ``self``
argument to figure out the instance where we should be
setting attributes.
Close pylint-dev/pylint#3216
* Clean up setup.py
Make pytest-runner a requirement only if running tests, similar to what was
done with McCabe.
Clean up the setup.py file, resolving a handful of minor warnings with it.
* Handle StopIteration error in infer_int.
Close pylint-dev/pylint#3274
* Can access per argument type comments for positional only and keyword only arguments.
The comments are accessed through through the new
``Arguments.type_comment_posonlyargs`` and
``Arguments.type_comment_kwonlyargs`` attributes respectively.
* Relax upper bound on `wrapt`
Close #755
* Properly analyze CFFI compiled extensions.
What's New in astroid 2.3.2?
============================
Release date: 2019-10-18
* All type comments have as parent the corresponding `astroid` node
Until now they had as parent the builtin `ast` node which meant
we were operating with primitive objects instead of our own.
Close pylint-dev/pylint#3174
* Pass an inference context to `metaclass()` when inferring an object type
This should prevent a bunch of recursion errors happening in pylint.
Also refactor the inference of `IfExp` nodes to use separate contexts
for each potential branch.
Close pylint-dev/pylint#3152
Close pylint-dev/pylint#3159
What's New in astroid 2.3.1?
============================
Release date: 2019-09-30
* A transform for the builtin `dataclasses` module was added.
This should address various `dataclasses` issues that were surfaced
even more after the release of pylint 2.4.0.
In the previous versions of `astroid`, annotated assign nodes were
allowed to be retrieved via `getattr()` but that no longer happens
with the latest `astroid` release, as those attribute are not actual
attributes, but rather virtual ones, thus an operation such as `getattr()`
does not make sense for them.
* Update attr brain to partly understand annotated attributes
Close #656
What's New in astroid 2.3.0?
============================
Release date: 2019-09-24
* Add a brain tip for ``subprocess.check_output``
Close #689
* Remove NodeNG.nearest method because of lack of usage in astroid and pylint.
Close #691
* Allow importing wheel files. Close #541
* Annotated AST follows PEP8 coding style when converted to string.
* Fix a bug where defining a class using type() could cause a DuplicateBasesError.
Close #644
* Dropped support for Python 3.4.
* Numpy brain support is improved.
Numpy's fundamental type ``numpy.ndarray`` has its own brain : ``brain_numpy_ndarray`` and
each numpy module that necessitates brain action has now its own numpy brain :
- ``numpy.core.numeric``
- ``numpy.core.function_base``
- ``numpy.core.multiarray``
- ``numpy.core.numeric``
- ``numpy.core.numerictypes``
- ``numpy.core.umath``
- ``numpy.random.mtrand``
Close pylint-dev/pylint#2865
Close pylint-dev/pylint#2747
Close pylint-dev/pylint#2721
Close pylint-dev/pylint#2326
Close pylint-dev/pylint#2021
* ``assert`` only functions are properly inferred as returning ``None``
Close #668
* Add support for Python 3.8's `NamedExpr` nodes, which is part of assignment expressions.
Close #674
* Added support for inferring `IfExp` nodes.
* Instances of exceptions are inferred as such when inferring in non-exception context
This allows special inference support for exception attributes such as `.args`.
Close pylint-dev/pylint#2333
* Drop a superfluous and wrong callcontext when inferring the result of a context manager
Close pylint-dev/pylint#2859
* ``igetattr`` raises ``InferenceError`` on re-inference of the same object
This prevents ``StopIteration`` from leaking when we encounter the same
object in the current context, which could result in various ``RuntimeErrors``
leaking in other parts of the inference.
Until we get a global context per inference, the solution is sort of a hack,
as with the suggested global context improvement, we could theoretically
reuse the same inference object.
Close #663
* Variable annotations can no longer be retrieved with `ClassDef.getattr`
Unless they have an attached value, class variable annotations can no longer
be retrieved with `ClassDef.getattr.`
* Improved builtin inference for ``tuple``, ``set``, ``frozenset``, ``list`` and ``dict``
We were properly inferring these callables *only* if they had consts as
values, but that is not the case most of the time. Instead we try to infer
the values that their arguments can be and use them instead of assuming
Const nodes all the time.
Close pylint-dev/pylint#2841
* The last except handler wins when inferring variables bound in an except handler.
Close pylint-dev/pylint#2777
* ``threading.Lock.locked()`` is properly recognized as a member of ``threading.Lock``
Close pylint-dev/pylint#2791
* Fix recursion error involving ``len`` and self referential attributes
Close pylint-dev/pylint#2736
Close pylint-dev/pylint#2734
Close pylint-dev/pylint#2740
* Can access per argument type comments through new ``Arguments.type_comment_args`` attribute.
Close #665
* Fix being unable to access class attributes on a NamedTuple.
Close pylint-dev/pylint#1628
* Fixed being unable to find distutils submodules by name when in a virtualenv.
Close pylint-dev/pylint#73
What's New in astroid 2.2.0?
============================
Release date: 2019-02-27
* Fix a bug concerning inference of calls to numpy function that should not return Tuple or List instances.
Close pylint-dev/pylint#2436
* Fix a bug where a method, which is a lambda built from a function, is not inferred as ``BoundMethod``
Close pylint-dev/pylint#2594
* ``typed_ast`` gets installed for Python 3.7, meaning type comments can now work on 3.7.
* Fix a bug concerning inference of unary operators on numpy types.
Close pylint-dev/pylint#2436 (first part)
* Fix a crash with ``typing.NamedTuple`` and empty fields. Close pylint-dev/pylint#2745
* Add a proper ``strerror`` inference to the ``OSError`` exceptions.
Close pylint-dev/pylint#2553
* Support non-const nodes as values of Enum attributes.
Close #612
* Fix a crash in the ``enum`` brain tip caused by non-assign members in class definitions.
Close pylint-dev/pylint#2719
* ``brain_numpy`` returns an undefined type for ``numpy`` methods to avoid ``assignment-from-no-return``
Close pylint-dev/pylint#2694
* Fix a bug where a call to a function that has been previously called via
functools.partial was wrongly inferred
Close pylint-dev/pylint#2588
* Fix a recursion error caused by inferring the ``slice`` builtin.
Close pylint-dev/pylint#2667
* Remove the restriction that "old style classes" cannot have a MRO.
This does not make sense any longer given that we run against Python 3
code.
Close pylint-dev/pylint#2701
* Added more builtin exceptions attributes. Close #580
* Add a registry for builtin exception models. Close pylint-dev/pylint#1432
* Add brain tips for `http.client`. Close pylint-dev/pylint#2687
* Prevent crashing when processing ``enums`` with mixed single and double quotes.
Close pylint-dev/pylint#2676
* ``typing`` types have the `__args__` property. Close pylint-dev/pylint#2419
* Fix a bug where an Attribute used as a base class was triggering a crash
Close #626
* Added special support for `enum.IntFlag`
Close pylint-dev/pylint#2534
* Extend detection of data classes defined with attr
Close #628
* Fix typo in description for brain_attrs
What's New in astroid 2.1.0?
============================
Release date: 2018-11-25
* ``threading.Lock.acquire`` has the ``timeout`` parameter now.
Close pylint-dev/pylint#2457
* Pass parameters by keyword name when inferring sequences.
Close pylint-dev/pylint#2526
* Correct line numbering for f-strings for complex embedded expressions
When a f-string contained a complex expression, such as an attribute access,
we weren't cloning all the subtree of the f-string expression for attaching the correct
line number. This problem is coming from the builtin AST parser which gives for the f-string
and for its underlying elements the line number 1, but this is causing all sorts of bugs and
problems in pylint, which expects correct line numbering.
Close pylint-dev/pylint#2449
* Add support for `argparse.Namespace`
Close pylint-dev/pylint#2413
* `async` functions are now inferred as `AsyncGenerator` when inferring their call result.
* Filter out ``Uninferable`` when inferring the call result result of a class with an uninferable ``__call__`` method.
Close pylint-dev/pylint#2434
* Make compatible with AST changes in Python 3.8.
* Subscript inference (e.g. "`a[i]`") now pays attention to multiple inferred values for value
(e.g. "`a`") and slice (e.g. "`i`")
Close #614
What's New in astroid 2.0.4?
============================
Release date: 2018-08-10
* Make sure that assign nodes can find ``yield`` statements in their values
Close pylint-dev/pylint#2400
What's New in astroid 2.0.3?
============================
Release date: 2018-08-08
* The environment markers for PyPy were invalid.
What's New in astroid 2.0.2?
============================
Release date: 2018-08-01
* Stop repeat inference attempt causing a RuntimeError in Python3.7
Close pylint-dev/pylint#2317
* infer_call_result can raise InferenceError so make sure to handle that for the call sites
where it is used
infer_call_result started recently to raise InferenceError for objects for which it
could not find any returns. Previously it was silently raising a StopIteration,
which was especially leaking when calling builtin methods.
Since it is after all an inference method, it is expected that it
could raise an InferenceError rather than returning nothing.
Close pylint-dev/pylint#2350
What's New in astroid 2.0.1?
============================
Release date: 2018-07-19
* Released to clear an old wheel package on PyPI
What's New in astroid 2.0?
==========================
Release date: 2018-07-15
* String representation of nodes takes in account precedence and associativity rules of operators.
* Fix loading files with `modutils.load_from_module` when
the path that contains it in `sys.path` is a symlink and
the file is contained in a symlinked folder.
Close #583
* Reworking of the numpy brain dealing with numerictypes
(use of inspect module to determine the class hierarchy of
numpy.core.numerictypes module)
Close pylint-dev/pylint#2140
* Added inference support for starred nodes in for loops
Close #146
* Support unpacking for dicts in assignments
Close #268
* Add support for inferring functools.partial
Close #125
* Inference support for `dict.fromkeys`
Close #110
* `int()` builtin is inferred as returning integers.
Close #150
* `str()` builtin is inferred as returning strings.
Close #148
* DescriptorBoundMethod has the correct number of arguments defined.
* Improvement of the numpy numeric types definition.
Close pylint-dev/pylint#1971
* Subclasses of *property* are now interpreted as properties
Close pylint-dev/pylint#1601
* AsStringRegexpPredicate has been removed.
Use transform predicates instead of it.
* Switched to using typed_ast for getting access to type comments
As a side effect of this change, some nodes gained a new `type_annotation` attribute,
which, if the type comments were correctly parsed, should contain a node object
with the corresponding objects from the type comment.
* typing.X[...] and typing.NewType are inferred as classes instead of instances.
* Module.__path__ is now a list
It used to be a string containing the path, but it doesn't reflect the situation
on Python, where it is actually a list.
* Fix a bug with namespace package's __path__ attribute.
Close #528
* Added brain tips for random.sample
Part of pylint-dev/pylint#811
* Add brain tip for `issubclass` builtin
Close #101.
* Fix submodule imports from six
Close pylint-dev/pylint#1640
* Fix missing __module__ and __qualname__ from class definition locals
Close pylint-dev/pylint#1753
* Fix a crash when __annotations__ access a parent's __init__ that does not have arguments
Close #473
* Fix multiple objects sharing the same InferenceContext.path causing uninferable results
Close #483
* Fix improper modification of col_offset, lineno upon inference of builtin functions
Close pylint-dev/pylint#1839
* Subprocess.Popen brain now knows of the args member
Close pylint-dev/pylint#1860
* add move_to_end method to collections.OrderedDict brain
Close pylint-dev/pylint#1872
* Include new hashlib classes added in python 3.6
* Fix RecursionError for augmented assign
Close #437, #447, #313, pylint-dev/pylint#1642, pylint-dev/pylint#1805, pylint-dev/pylint#1854, pylint-dev/pylint#1452
* Add missing attrs special attribute
Close pylint-dev/pylint#1884
* Inference now understands the 'isinstance' builtin
Close #98
* Stop duplicate nodes with the same key values
from appearing in dictionaries from dictionary unpacking.
Close pylint-dev/pylint#1843
* Fix ``contextlib.contextmanager`` inference for nested context managers
Close #1699
* Implement inference for len builtin
Close #112
* Add qname method to Super object preventing potential errors in upstream
pylint
Close #533
* Stop astroid from getting stuck in an infinite loop if a function shares
its name with its decorator
Close #375
* Fix issue with inherited __call__ improperly inferencing self
Close #pylint-dev/pylint#2199
* Fix __call__ precedence for classes with custom metaclasses
Close pylint-dev/pylint#2159
* Limit the maximum amount of interable result in an NodeNG.infer() call to
100 by default for performance issues with variables with large amounts of
possible values.
The max inferable value can be tuned by setting the `max_inferable_values` flag on
astroid.MANAGER.
What's New in astroid 1.6.0?
============================
Release date: 2017-12-15
* When verifying duplicates classes in MRO, ignore on-the-fly generated classes
Close pylint-dev/pylint#1706
* Add brain tip for attrs library to prevent unsupported-assignment-operation false positives
Close pylint-dev/pylint#1698
* file_stream was removed, since it was deprecated for three releases
Instead one should use the .stream() method.
* Vast improvements to numpy support
* Add brain tips for curses
Close pylint-dev/pylint#1703
* Add brain tips for UUID.int
Close pylint-dev/pylint#961
* The result of using object.__new__ as class decorator is correctly inferred as instance
Close #172
* Enums created with functional syntax are now iterable
* Enums created with functional syntax are now subscriptable
* Don't crash when getting the string representation of BadUnaryOperationMessage
In some cases, when the operand does not have a .name attribute,
getting the string representation of a BadUnaryOperationMessage leads
to a crash.
Close pylint-dev/pylint#1563
* Don't raise DuplicateBaseError when classes at different locations are used
For instance, one can implement a namedtuple base class, which gets reused
on a class with the same name later on in the file. Until now, we considered
these two classes as being the same, because they shared the name, but in fact
they are different, being created at different locations and through different
means.
Close pylint-dev/pylint#1458
* The func form of namedtuples with keywords is now understood
Close pylint-dev/pylint#1530
* Fix inference for nested calls
* Dunder class at method level is now inferred as the class of the method
Close pylint-dev/pylint#1328
* Stop most inference tip overwrites from happening by using
predicates on existing inference_tip transforms.
Close #472
* Fix object.__new__(cls) calls in classmethods by using
a context which has the proper boundnode for the given
argument
Close #404
* Fix Pathlib type inference
Close pylint-dev/pylint#224
Close pylint-dev/pylint#1660
What's New in astroid 1.5.3?
============================
Release date: 2017-06-03
* enum34 dependency is forced to be at least version 1.1.3. Fixes spurious
bug related to enum classes being falsy in boolean context, which caused
``_Inconsistent Hierarchy_`` ``RuntimeError`` in ``singledispatch`` module.
See links below for details:
- http://bugs.python.org/issue26748
- https://bitbucket.org/ambv/singledispatch/issues/8/inconsistent-hierarchy-with-enum
- https://bitbucket.org/stoneleaf/enum34/commits/da50803651ab644e6fce66ebc85562f1117c344b
* Do not raise an exception when uninferable value is unpacked in ``with`` statement.
* Lock objects from ``threading`` module are now correctly recognised
as context managers.
What's New in astroid 1.5.2?
============================
Release date: 2017-04-17
* Basic support for the class form of typing.NamedTuple
* mro() can be computed for classes with old style classes in the hierarchy
What's New in astroid 1.5.0?
============================
Release date: 2017-04-13
* Arguments node gained a new attribute, ``kwonlyargs_annotations``
This new attribute holds the annotations for the keyword-only
arguments.
* `namedtuple` inference now understands `rename` keyword argument
* Classes can now know their definition-time arguments.
Classes can support keyword arguments, which are passed when
a class is constructed using ``__new__``.
* Add support for inferring typing.NamedTuple.
* ClassDef now supports __getitem__ inference through the metaclass.
* getitem() method accepts nodes now, instead of Python objects.
* Add support for explicit namespace packages, created with pkg_resources.
* Add brain tips for _io.TextIOWrapper's buffer and raw attributes.
* Add `returns` into the proper order in FunctionDef._astroid_fields
The order is important, since it determines the last child,
which in turn determines the last line number of a scoped node.
* Add brain tips for functools.lru_cache.
* New function, astroid.extract_node, exported out from astroid.test_utils.
* Stop saving assignment locals in ExceptHandlers, when the context is a store.
This fixes a tripping case, where the RHS of a ExceptHandler can be redefined
by the LHS, leading to a local save. For instance, ``except KeyError, exceptions.IndexError``
could result in a local save for IndexError as KeyError, resulting in potential unexpected
inferences. Since we don't lose a lot, this syntax gets prohibited.
* Fix a crash which occurred when the class of a namedtuple could not be inferred.
* Add support for implicit namespace packages (PEP 420)
This change involves a couple of modifications. First, we're relying on a
spec finder protocol, inspired by importlib's ModuleSpec, for finding where
a file or package is, using importlib's PathFinder as well, which enable
us to discover namespace packages as well.
This discovery is the center piece of the namespace package support,
the other part being the construction of a dummy Module node whenever
a namespace package root directory is requested during astroid's import
references.
* Introduce a special attributes model
Through this model, astroid starts knowing special attributes of certain Python objects,
such as functions, classes, super objects and so on. This was previously possible before,
but now the lookup and the attributes themselves are separated into a new module,
objectmodel.py, which describes, in a more comprehensive way, the data model of each
object.
* Exceptions have their own object model
Some of exceptions's attributes, such as .args and .message,
can't be inferred correctly since they are descriptors that get
transformed into the proper objects at runtime. This can cause issues
with the static analysis, since they are inferred as different than
what's expected. Now when we're creating instances of exceptions,
we're inferring a special object that knows how to transform those
runtime attributes into the proper objects via a custom object model.
Closes issue #81
* dict.values, dict.keys and dict.items are properly
inferred to their corresponding type, which also
includes the proper containers for Python 3.
* Fix a crash which occurred when a method had a same name as a builtin object,
decorated at the same time by that builtin object ( a property for instance)
* The inference can handle the case where the attribute is accessed through a subclass
of a base class and the attribute is defined at the base class's level,
by taking in consideration a redefinition in the subclass.
This should fix https://github.com/pylint-dev/pylint/issues/432
* Calling lambda methods (defined at class level) can be understood.
* Don't take in consideration invalid assignments, especially when __slots__
declaration forbids them.
Close issue #332
* Functional form of enums support accessing values through __call__.
* Brain tips for the ssl library.
* decoratornames() does not leak InferenceError anymore.
* wildcard_imported_names() got replaced by _public_names()
Our understanding of wildcard imports through __all__ was
half baked to say at least, since we couldn't account for
modifications of the list, which results in tons of false positives.
Instead, we replaced it with _public_names(), a method which returns
all the names that are publicly available in a module, that is that
don't start with an underscore, even though this means that there
is a possibility for other names to be leaked out even though
they are not present in the __all__ variable.
The method is private in 1.4.X.
* unpack_infer raises InferenceError if it can't operate
with the given sequences of nodes.
* Support accessing properties with super().
* Enforce strong updates per frames.
When looking up a name in a scope, Scope.lookup will return
only the values which will be reachable after execution, as seen
in the following code:
a = 1
a = 2
In this case it doesn't make sense to return two values, but
only the last one.
* Add support for inference on threading.Lock
As a matter of fact, astroid can infer on threading.RLock,
threading.Semaphore, but can't do it on threading.Lock (because it comes
from an extension module).
* pkg_resources brain tips are a bit more specific,
by specifying proper returns.
* The slots() method conflates all the slots from the ancestors
into a list of current and parent slots.
We're doing this because this is the right semantics of slots,
they get inherited, as long as each parent defines a __slots__
entry.
* Some nodes got a new attribute, 'ctx', which tells in which context
the said node was used.
The possible values for the contexts are `Load` ('a'), `Del`
('del a'), `Store` ('a = 4') and the nodes that got the new
attribute are Starred, Subscript, List and Tuple. Closes issue #267.
* relative_to_absolute_name or methods calling it will now raise
TooManyLevelsError when a relative import was trying to
access something beyond the top-level package.
* AstroidBuildingException is now AstroidBuildingError. The first
name will exist until astroid 2.0.
* Add two new exceptions, AstroidImportError and AstroidSyntaxError.
They are subclasses of AstroidBuildingException and are raised when
a module can't be imported from various reasons.
Also do_import_module lets the errors to bubble up without converting
them to InferenceError. This particular conversion happens only
during the inference.
* Revert to using printf-style formatting in as_string, in order
to avoid a potential problem with encodings when using .format.
Closes issue #273. Patch by notsqrt.
* assigned_stmts methods have the same signature from now on.
They used to have different signatures and each one made
assumptions about what could be passed to other implementations,
leading to various possible crashes when one or more arguments
weren't given. Closes issue #277.
* Fix metaclass detection, when multiple keyword arguments
are used in class definition.
* Add support for annotated variable assignments (PEP 526)
* Starred expressions are now inferred correctly for tuple,
list, set, and dictionary literals.
* Support for asynchronous comprehensions introduced in Python 3.6.
Fixes #399. See PEP530 for details.
What's New in astroid 1.4.1?
============================
Release date: 2015-11-29
* Add support for handling Uninferable nodes when calling as_string
Some object, for instance List or Tuple can have, after inference,
Uninferable as their elements, happening when their components
weren't couldn't be inferred properly. This means that as_string
needs to cope with expecting Uninferable nodes part of the other
nodes coming for a string transformation. The patch adds a visit
method in AsString and ``accept`` on Yes / Uninferable nodes.
Closes issue #270.
What's New in astroid 1.4.0?
============================
Release date: 2015-11-29
* Class.getattr('__mro__') returns the actual MRO. Closes issue #128.
* The logilab-common dependency is not needed anymore as the needed code
was integrated into astroid.
* Generated enum member stubs now support IntEnum and multiple
base classes.
* astroid.builder.AstroidBuilder.string_build and
astroid.builder.AstroidBuilder.file_build are now raising
AstroidBuildingException when the parsing of the string raises
a SyntaxError.
* Add brain tips for multiprocessing.Manager and
multiprocessing.managers.SyncManager.
* Add some fixes which enhances the Jython support.
The fix mostly includes updates to modutils, which is
modified in order to properly lookup paths from live objects,
which ends in $py.class, not pyc as for Python 2,
Closes issue #83.
* The Generator objects inferred with `infer_call_result`
from functions have as parent the function from which they
are returned.
* Add brain tips for multiprocessing post Python 3.4+,
where the module level functions are retrieved with getattr
from a context object, leading to many no-member errors
in Pylint.
* Understand partially the 3-argument form of `type`.
The only change is that astroid understands members
passed in as dictionaries as the third argument.
* .slots() will return an empty list for classes with empty slots.
Previously it returned None, which is the same value for
classes without slots at all. This was changed in order
to better reflect what's actually happening.
* Improve the inference of Getattr nodes when dealing with
abstract properties from the abc module.
In astroid.bases.Instance._wrap_attr we had a detection
code for properties, which basically inferred whatever
a property returned, passing the results up the stack,
to the igetattr() method. It handled only the builtin property
but the new patch also handles a couple of other properties,
such as abc.abstractproperty.
* UnboundMethod.getattr calls the getattr of its _proxied object
and doesn't call super(...) anymore.
It previously crashed, since the first ancestor in its mro was
bases.Proxy and bases.Proxy doesn't implement the .getattr method.
Closes issue #91.
* Don't hard fail when calling .mro() on a class which has
combined both newstyle and old style classes. The class
in question is actually newstyle (and the __mro__ can be
retrieved using Python).
.mro() fallbacks to using .ancestors() in that case.
* Class.local_attr and Class.local_attr_ancestors uses internally
a mro lookup, using .mro() method, if they can.
That means for newstyle classes, when trying to lookup a member
using one of these functions, the first one according to the
mro will be returned. This reflects nicely the reality,
but it can have as a drawback the fact that it is a behaviour
change (the previous behaviour was incorrect though). Also,
having bases which can return multiple values when inferred
will not work with the new approach, because .mro() only
retrieves the first value inferred from a base.
* Expose an implicit_metaclass() method in Class. This will return
a builtins.type instance for newstyle classes.
* Add two new exceptions for handling MRO error cases. DuplicateBasesError
is emitted when duplicate bases are found in a class,
InconsistentMroError is raised when the method resolution is determined
to be inconsistent. They share a common class, MroError, which
is a subclass of ResolveError, meaning that this change is backwards
compatible.
* Classes aren't marked as interfaces anymore, in the `type` attribute.
* Class.has_dynamic_getattr doesn't return True for special methods
which aren't implemented in pure Python, as it is the case for extension modules.
Since most likely the methods were coming from a live object, this implies
that all of them will have __getattr__ and __getattribute__ present and it
is wrong to consider that those methods were actually implemented.
* Add basic support for understanding context managers.
Currently, there's no way to understand whatever __enter__ returns in a
context manager and what it is bound using the ``as`` keyword. With these changes,
we can understand ``bar`` in ``with foo() as bar``, which will be the result of __enter__.
* Add a new type of node, called *inference objects*. Inference objects are similar with
AST nodes, but they can be obtained only after inference, so they can't be found
inside the original AST tree. Their purpose is to handle at astroid level
some operations which can't be handled when using brain transforms.
For instance, the first object added is FrozenSet, which can be manipulated
at astroid's level (inferred, itered etc). Code such as this 'frozenset((1,2))'
will not return an Instance of frozenset, without having access to its
content, but a new objects.FrozenSet, which can be used just as a nodes.Set.
* Add a new *inference object* called Super, which also adds support for understanding
super calls. astroid understands the zero-argument form of super, specific to
Python 3, where the interpreter fills itself the arguments of the call. Also, we
are understanding the 2-argument form of super, both for bounded lookups
(super(X, instance)) as well as for unbounded lookups (super(X, Y)),
having as well support for validating that the object-or-type is a subtype
of the first argument. The unbounded form of super (one argument) is not
understood, since it's useless in practice and should be removed from
Python's specification. Closes issue #89.
* Add inference support for getattr builtin. Now getattr builtins are
properly understood. Closes issue #103.
* Add inference support for hasattr builtin. Closes issue #102.
* Add 'assert_equals' method in nose.tools's brain plugin.
* Don't leak StopIteration when inferring invalid UnaryOps (+[], +None etc.).
* Improve the inference of UnaryOperands.
When inferring unary operands, astroid looks up the return value
of __pos__, __neg__ and __invert__ to determine the inferred value
of ``~node``, ``+node`` or ``-node``.
* Improve the inference of six.moves, especially when using `from ... import ...`
syntax. Also, we added a new fail import hook for six.moves, which fixes the
import-error false positive from pylint. Closes issue #107.
* Make the first steps towards detecting type errors for unary and binary
operations.
In exceptions, one object was added for holding information about a possible
UnaryOp TypeError, object called `UnaryOperationError`. Even though the name
suggests it's an exception, it's actually not one. When inferring UnaryOps,
we use this special object to mark a possible TypeError,
object which can be interpreted by pylint in order to emit a new warning.
We are also exposing a new method for UnaryOps, called `type_errors`,
which returns a list of UnaryOperationsError.
* A new method was added to the AST nodes, 'bool_value'. It is used to deduce
the value of a node when used in a boolean context, which is useful
for both inference, as well as for data flow analysis, where we are interested
in what branches will be followed when the program will be executed.
`bool_value` returns True, False or YES, if the node's boolean value can't
be deduced. The method is used when inferring the unary operand `not`.
Thus, `not something` will result in calling `something.bool_value` and
negating the result, if it is a boolean.
* Add inference support for boolean operations (`and` and `not`).
* Add inference support for the builtin `callable`.
* astroid.inspector was moved to pylint.pyreverse, since
it is the only known client of this module. No other change
was made to the exported API.
* astroid.utils.ASTWalker and astroid.utils.LocalsVisitor
were moved to pylint.pyreverse.utils.
* Add inference support for the builtin `bool`.
* Add `igetattr` method to scoped_nodes.Function.
* Add support for Python 3.5's MatMul operation: see PEP 465 for more
details.
* NotImplemented is detected properly now as being part of the
builtins module. Previously trying to infer the Name(NotImplemented)
returned an YES object.
* Add astroid.helpers, a module of various useful utilities which don't
belong yet into other components. Added *object_type*, a function
which can be used to obtain the type of almost any astroid object,
similar to how the builtin *type* works.
* Understand the one-argument form of the builtin *type*.
This uses the recently added *astroid.helpers.object_type* in order to
retrieve the Python type of the first argument of the call.
* Add helpers.is_supertype and helpers.is_subtype, two functions for
checking if an object is a super/sub type of another.
* Improve the inference of binary arithmetic operations (normal
and augmented).
* Add support for retrieving TypeErrors for binary arithmetic operations.
The change is similar to what was added for UnaryOps: a new method
called *type_errors* for both AugAssign and BinOp, which can be used
to retrieve type errors occurred during inference. Also, a new
exception object was added, BinaryOperationError.
* Lambdas found at class level, which have a `self` argument, are considered
BoundMethods when accessing them from instances of their class.
* Add support for multiplication of tuples and lists with instances
which provides an __index__ returning-int method.
* Add support for indexing containers with instances which provides
an __index__ returning-int method.
* Star unpacking in assignments returns properly a list,
not the individual components. Closes issue #138.
* Add annotation support for function.as_string(). Closes issue #37.
* Add support for indexing bytes on Python 3.
* Add support for inferring subscript on instances, which will
use __getitem__. Closes issue #124.
* Add support for pkg_resources.declare_namespaces.
* Move pyreverse specific modules and functionality back into pyreverse
(astroid.manager.Project, astroid.manager.Manager.project_from_files).
* Understand metaclasses added with six.add_metaclass decorator. Closes issue #129.
* Add a new convenience API, `astroid.parse`, which can be used to retrieve
an astroid AST from a source code string, similar to how ast.parse can be
used to obtain a Python AST from a source string. This is the test_utils.build_module
promoted to a public API.
* do_import_module passes the proper relative_only flag if the level is higher
than 1. This has the side effect that using `from .something import something`
in a non-package will finally result in an import-error on Pylint's side.
Until now relative_only was ignored, leading to the import of `something`,
if it was globally available.
* Add get_wrapping_class API to scoped_nodes, which can be used to
retrieve the class that wraps a node.
* Class.getattr looks by default in the implicit and the explicit metaclasses,
which is `type` on Python 3.
Closes issue #114.
* There's a new separate step for transforms.
Until now, the transforms were applied at the same time the tree was
being built. This was problematic if the transform functions were
using inference, since the inference was executed on a partially
constructed tree, which led to failures when post-building
information was needed (such as setting the _from_names
for the From imports).
Now there's a separate step for transforms, which are applied
using transform.TransformVisitor.
There's a couple of other related changes:
* astroid.parse and AstroidBuilder gained a new parameter
`apply_transforms`, which is a boolean flag, which will
control if the transforms are applied. We do this because
there are uses when the vanilla tree is wanted, without
any implicit modification.
* the transforms are also applied for builtin modules,
as a side effect of the fact that transform visiting
was moved in AstroidBuilder._post_build from
AstroidBuilder._data_build.
Closes issue #116.
* Class._explicit_metaclass is now a public API, in the form of
Class.declared_metaclass.
Class.mro remains the de facto method for retrieving the metaclass
of a class, which will also do an evaluation of what declared_metaclass
returns.
* Understand slices of tuples, lists, strings and instances with support
for slices.
Closes issue #137.
* Add proper grammatical names for `inferred` and `ass_type` methods,
namely `inferred` and `assign_type`.
The old methods will raise PendingDeprecationWarning, being slated
for removal in astroid 2.0.
* Add new AST names in order to be similar to the ones
from the builtin ast module.
With this change, Getattr becomes Attributes, Backquote becomes
Repr, Class is ClassDef, Function is FunctionDef, Discard is Expr,
CallFunc is Call, From is ImportFrom, AssName is AssignName
and AssAttr is AssignAttr. The old names are maintained for backwards
compatibility and they are interchangeable, in the sense that using
Discard will use Expr under the hood and the implemented visit_discard
in checkers will be called with Expr nodes instead. The AST does not
contain the old nodes, only the interoperability between them hides this
fact. Recommendations to move to the new nodes are emitted accordingly,
the old names will be removed in astroid 2.0.
* Add support for understanding class creation using `type.__new__(mcs, name, bases, attrs)``
Until now, inferring this kind of calls resulted in Instances, not in classes,
since astroid didn't understand that the presence of the metaclass in the call
leads to a class creating, not to an instance creation.
* Understand the `slice` builtin. Closes issue #184.
* Add brain tips for numpy.core, which should fix Pylint's #453.
* Add a new node, DictUnpack, which is used to represent the unpacking
of a dictionary into another dictionary, using PEP 448 specific syntax
``({1:2, **{2:3})``
This is a different approach than what the builtin ast module does,
since it just uses None to represent this kind of operation,
which seems conceptually wrong, due to the fact the AST contains
non-AST nodes. Closes issue #206.
What's New in astroid 1.3.6?
============================
Release date: 2015-03-14
* Class.slots raises NotImplementedError for old style classes.
Closes issue #67.
* Add a new option to AstroidManager, `optimize_ast`, which
controls if peephole optimizer should be enabled or not.
This prevents a regression, where the visit_binop method
wasn't called anymore with astroid 1.3.5, due to the differences
in the resulting AST. Closes issue #82.
What's New in astroid 1.3.5?
============================
Release date: 2015-03-11
* Add the ability to optimize small ast subtrees,
with the first use in the optimization of multiple
BinOp nodes. This removes recursivity in the rebuilder
when dealing with a lot of small strings joined by the
addition operator. Closes issue #59.
* Obtain the methods for the nose brain tip through an
unittest.TestCase instance. Closes Pylint issue #457.
* Fix a crash which occurred when a class was the ancestor
of itself. Closes issue #78.
* Improve the scope_lookup method for Classes regarding qualified
objects, with an attribute name exactly as one provided in the
class itself.
For example, a class containing an attribute 'first',
which was also an import and which had, as a base, a qualified name
or a Gettattr node, in the form 'module.first', then Pylint would
have inferred the `first` name as the function from the Class,
not the import. Closes Pylint issue #466.
* Implement the assigned_stmts operation for Starred nodes,
which was omitted when support for Python 3 was added in astroid.
Closes issue #36.
What's New in astroid 1.3.4?
============================
Release date: 2015-01-17
* Get the first element from the method list when obtaining
the functions from nose.tools.trivial. Closes Pylint issue #448.
What's New in astroid 1.3.3?
============================
Release date: 2015-01-16
* Restore file_stream to a property, but deprecate it in favour of
the newly added method Module.stream. By using a method instead of a
property, it will be easier to properly close the file right
after it is used, which will ensure that no file descriptors are
leaked. Until now, due to the fact that a module was cached,
it was not possible to close the file_stream anywhere.
file_stream will start emitting PendingDeprecationWarnings in
astroid 1.4, DeprecationWarnings in astroid 1.5 and it will
be finally removed in astroid 1.6.
* Add inference tips for 'tuple', 'list', 'dict' and 'set' builtins.
* Add brain definition for most string and unicode methods
* Changed the API for Class.slots. It returns None when the class
doesn't define any slots. Previously, for both the cases where
the class didn't have slots defined and when it had an empty list
of slots, Class.slots returned an empty list.
* Add a new method to Class nodes, 'mro', for obtaining the
the method resolution order of the class.
* Add brain tips for six.moves. Closes issue #63.
* Improve the detection for functions decorated with decorators
which returns static or class methods.
* .slots() can contain unicode strings on Python 2.
* Add inference tips for nose.tools.
What's New in astroid 1.3.2?
============================
Release date: 2014-11-22
* Fixed a crash with invalid subscript index.
* Implement proper base class semantics for Python 3, where
every class derives from object.
* Allow more fine-grained control over C extension loading
in the manager.
What's New in astroid 1.3.1?
============================
Release date: 2014-11-21
* Fixed a crash issue with the pytest brain module.
What's New in astroid 1.3.0?
============================
Release date: 2014-11-20
* Fix a maximum recursion error occurred during the inference,
where statements with the same name weren't filtered properly.
Closes pylint issue #295.
* Check that EmptyNode has an underlying object in
EmptyNode.has_underlying_object.
* Simplify the understanding of enum members.
* Fix an infinite loop with decorator call chain inference,
where the decorator returns itself. Closes issue #50.
* Various speed improvements. Patch by Alex Munroe.
* Add pytest brain plugin. Patch by Robbie Coomber.
* Support for Python versions < 2.7 has been dropped, and the
source has been made compatible with Python 2 and 3. Running
2to3 on installation for Python 3 is not needed anymore.
* astroid now depends on six.
* modutils._module_file opens __init__.py in binary mode.
Closes issues #51 and #13.
* Only C extensions from trusted sources (the standard library)
are loaded into the examining Python process to build an AST
from the live module.
* Path names on case-insensitive filesystems are now properly
handled. This fixes the stdlib detection code on Windows.
* Metaclass-generating functions like six.with_metaclass
are now supported via some explicit detection code.
* astroid.register_module_extender has been added to generalize
the support for module extenders as used by many brain plugins.
* brain plugins can now register hooks to handle failed imports,
as done by the gobject-introspection plugin.
* The modules have been moved to a separate package directory,
`setup.py develop` now works correctly.
What's New in astroid 1.2.1?
============================
Release date: 2014-08-24
* Fix a crash occurred when inferring decorator call chain.
Closes issue #42.
* Set the parent of vararg and kwarg nodes when inferring them.
Closes issue #43.
* namedtuple inference knows about '_fields' attribute.
* enum members knows about the methods from the enum class.
* Name inference will lookup in the parent function
of the current scope, in case searching in the current scope
fails.
* Inference of the functional form of the enums takes into
consideration the various inputs that enums accepts.
* The inference engine handles binary operations (add, mul etc.)
between instances.
* Fix an infinite loop in the inference, by returning a copy
of instance attributes, when calling 'instance_attr'.
Closes issue #34 (patch by Emile Anclin).
* Don't crash when trying to infer unbound object.__new__ call.
Closes issue #11.
What's New in astroid 1.2.0?
============================
Release date: 2014-07-25
* Function nodes can detect decorator call chain and see if they are
decorated with builtin descriptors (`classmethod` and `staticmethod`).
* infer_call_result called on a subtype of the builtin type will now
return a new `Class` rather than an `Instance`.
* `Class.metaclass()` now handles module-level __metaclass__ declaration
on python 2, and no longer looks at the __metaclass__ class attribute on
python 3.
* Function nodes can detect if they are decorated with subclasses
of builtin descriptors when determining their type
(`classmethod` and `staticmethod`).
* Add `slots` method to `Class` nodes, for retrieving
the list of valid slots it defines.
* Expose function annotation to astroid: `Arguments` node
exposes 'varargannotation', 'kwargannotation' and 'annotations'
attributes, while `Function` node has the 'returns' attribute.
* Backported most of the logilab.common.modutils module there, as
most things there are for pylint/astroid only and we want to be
able to fix them without requiring a new logilab.common release
* Fix names grabbed using wildcard import in "absolute import mode"
(ie with absolute_import activated from the __future__ or with
python 3). Fix pylint issue #58.
* Add support in pylint-brain for understanding enum classes.
What's New in astroid 1.1.1?
============================
Release date: 2014-04-30
* `Class.metaclass()` looks in ancestors when the current class
does not define explicitly a metaclass.
* Do not cache modules if a module with the same qname is already
known, and only return cached modules if both name and filepath
match. Fixes pylint Bitbucket issue #136.
What's New in astroid 1.1.0?
============================
Release date: 2014-04-18
* All class nodes are marked as new style classes for Py3k.
* Add a `metaclass` function to `Class` nodes to
retrieve their metaclass.
* Add a new YieldFrom node.
* Add support for inferring arguments to namedtuple invocations.
* Make sure that objects returned for namedtuple
inference have parents.
* Don't crash when inferring nodes from `with` clauses
with multiple context managers. Closes #18.
* Don't crash when a class has some __call__ method that is not
inferable. Closes #17.
* Unwrap instances found in `.ancestors()`, by using their _proxied
class.
What's New in astroid 1.0.1?
============================
Release date: 2013-10-18
* fix py3k/windows installation issue (issue #4)
* fix bug with namedtuple inference (issue #3)
* get back gobject introspection from pylint-brain
* fix some test failures under pypy and py3.3, though there is one remaining
in each of these platform (2.7 tests are all green)
What's New in astroid 1.0.0?
=============================
Release date: 2013-07-29
* Fix some omissions in py2stdlib's version of hashlib and
add a small test for it.
* Properly recognize methods annotated with abc.abstract{property,method}
as abstract.
* Allow transformation functions on any node, providing a
``register_transform`` function on the manager instead of the
``register_transformer`` to make it more flexible wrt node selection
* Use the new transformation API to provide support for namedtuple
(actually in pylint-brain, closes #8766)
* Added the test_utils module for building ASTs and
extracting deeply nested nodes for easier testing.
* Add support for py3k's keyword only arguments (PEP 3102)
* RENAME THE PROJECT to astroid
What's New in astroid 0.24.3?
=============================
Release date: 2013-04-16
* #124360 [py3.3]: Don't crash on 'yield from' nodes
* #123062 [pylint-brain]: Use correct names for keywords for urlparse
* #123056 [pylint-brain]: Add missing methods for hashlib
* #123068: Fix inference for generator methods to correctly handle yields
in lambdas.
* #123068: Make sure .as_string() returns valid code for yields in
expressions.
* #47957: Set literals are now correctly treated as inference leaves.
* #123074: Add support for inference of subscript operations on dict
literals.
What's New in astroid 0.24.2?
=============================
Release date: 2013-02-27
* pylint-brain: more subprocess.Popen faking (see #46273)
* #109562 [jython]: java modules have no __doc__, causing crash
* #120646 [py3]: fix for python3.3 _ast changes which may cause crash
* #109988 [py3]: test fixes
What's New in astroid 0.24.1?
=============================
Release date: 2012-10-05
* #106191: fix __future__ absolute import w/ From node
* #50395: fix function fromlineno when some decorator is splited on
multiple lines (patch by Mark Gius)
* #92362: fix pyreverse crash on relative import
* #104041: fix crash 'module object has no file_encoding attribute'
* #4294 (pylint-brain): bad inference on mechanize.Browser.open
* #46273 (pylint-brain): bad inference subprocess.Popen.communicate
What's New in astroid 0.24.0?
=============================
Release date: 2012-07-18
* include pylint brain extension, describing some stuff not properly understood until then.
(#100013, #53049, #23986, #72355)
* #99583: fix raw_building.object_build for pypy implementation
* use `open` rather than `file` in scoped_nodes as 2to3 miss it
What's New in astroid 0.23.1?
=============================
Release date: 2011-12-08
* #62295: avoid "OSError: Too many open files" by moving
.file_stream as a Module property opening the file only when needed
* Lambda nodes should have a `name` attribute
* only call transformers if modname specified
What's New in astroid 0.23.0?
=============================
Release date: 2011-10-07
* #77187: ancestor() only returns the first class when inheriting
from two classes coming from the same module
* #76159: putting module's parent directory on the path causes problems
linting when file names clash
* #74746: should return empty module when __main__ is imported (patch by
google)
* #74748: getitem protocol return constant value instead of a Const node
(patch by google)
* #77188: support lgc.decorators.classproperty
* #77253: provide a way for user code to register astng "transformers"
using manager.register_transformer(callable) where callable will be
called after an astng has been built and given the related module node
as argument
What's New in astroid 0.22.0?
=============================
Release date: 2011-07-18
* added column offset information on nodes (patch by fawce)
* #70497: Crash on AttributeError: 'NoneType' object has no attribute '_infer_name'
* #70381: IndentationError in import causes crash
* #70565: absolute imports treated as relative (patch by Jacek Konieczny)
* #70494: fix file encoding detection with python2.x
* py3k: __builtin__ module renamed to builtins, we should consider this to properly
build ast for builtin objects
What's New in astroid 0.21.1?
=============================
Release date: 2011-01-11
* python3: handle file encoding; fix a lot of tests
* fix #52006: "True" and "False" can be assigned as variable in Python2x
* fix #8847: pylint doesn't understand function attributes at all
* fix #8774: iterator / generator / next method
* fix bad building of ast from living object w/ container classes
(eg dict, set, list, tuple): contained elements should be turned to
ast as well (not doing it will much probably cause crash later)
* somewhat fix #57299 and other similar issue: Exception when
trying to validate file using PyQt's PyQt4.QtCore module: we can't
do much about it but at least catch such exception to avoid crash
What's New in astroid 0.21.0?
=============================
Release date: 2010-11-15
* python3.x: first python3.x release
* fix #37105: Crash on AttributeError: 'NoneType' object has no attribute '_infer_name'
* python2.4: drop python < 2.5 support
What's New in astroid 0.20.4?
=============================
Release date: 2010-10-27
* fix #37868 #37665 #33638 #37909: import problems with absolute_import_activated
* fix #8969: false positive when importing from zip-safe eggs
* fix #46131: minimal class decorator support
* minimal python2.7 support (dict and set comprehension)
* important progress on Py3k compatibility
What's New in astroid 0.20.3?
=============================
Release date: 2010-09-28
* restored python 2.3 compatibility
* fix #45959: AttributeError: 'NoneType' object has no attribute 'frame', due
to handling of __class__ when importing from living object (because of missing
source code or C-compiled object)
What's New in astroid 0.20.2?
=============================
Release date: 2010-09-10
* fix astng building bug: we've to set module.package flag at the node
creation time otherwise we'll miss this information when inferring relative
import during the build process (this should fix for instance some problems
with numpy)
* added __subclasses__ to special class attribute
* fix Class.interfaces so that no InferenceError raised on empty __implements__
* yield YES on multiplication of tuple/list with non valid operand
What's New in astroid 0.20.1?
=============================
Release date: 2010-05-11
* fix licensing to LGPL
* add ALL_NODES_CLASSES constant to nodes module
* nodes redirection cleanup (possible since refactoring)
* bug fix for python < 2.5: add Delete node on Subscript nodes if we are in a
del context
What's New in astroid 0.20.0?
=============================
Release date: 2010-03-22
* fix #20464: raises ?TypeError: '_Yes' object is not iterable? on list inference
* fix #19882: pylint hangs
* fix #20759: crash on pyreverse UNARY_OP_METHOD KeyError '~'
* fix #20760: crash on pyreverse : AttributeError: 'Subscript'
object has no attribute 'infer_lhs'
* fix #21980: [Python-modules-team] Bug#573229 : Pylint hangs;
improving the cache yields a speed improvement on big projects
* major refactoring: rebuild the tree instead of modify / monkey patching
* fix #19641: "maximum recursion depth exceeded" messages w/ python 2.6
this was introduced by a refactoring
* Ned Batchelder patch to properly import eggs with Windows line
endings. This fixes a problem with pylint not being able to
import setuptools.
* Winfried Plapper patches fixing .op attribute value for AugAssign nodes,
visit_ifexp in nodes_as_string
* Edward K. Ream / Tom Fleck patch closes #19641 (maximum recursion depth
exceeded" messages w/ python 2.6), see https://bugs.launchpad.net/pylint/+bug/456870
What's New in astroid 0.19.3?
=============================
Release date: 2009-12-18
* fix name error making 0.19.2 almost useless
What's New in astroid 0.19.2?
=============================
Release date: 2009-12-18
* fix #18773: inference bug on class member (due to bad handling of instance
/ class nodes "bounded" to method calls)
* fix #9515: strange message for non-class "Class baz has no egg member" (due to
bad inference of function call)
* fix #18953: inference fails with augmented assignment (special case for augmented
assignment in infer_ass method)
* fix #13944: false positive for class/instance attributes (Instance.getattr
should return assign nodes on instance classes as well as instance.
* include spelling fixes provided by Dotan Barak
What's New in astroid 0.19.1?
=============================
Release date: 2009-08-27
* fix #8771: crash on yield expression
* fix #10024: line numbering bug with try/except/finally
* fix #10020: when building from living object, __name__ may be None
* fix #9891: help(logilab.astng) throws TypeError
* fix #9588: false positive E1101 for augmented assignment
What's New in astroid 0.19.0?
=============================
Release date: 2009-03-25
* fixed python 2.6 issue (tests ok w/ 2.4, 2.5, 2.6. Anyone using 2.2 / 2.3
to tell us if it works?)
* some understanding of the __builtin__.property decorator
* inference: introduce UnboundMethod / rename InstanceMethod to BoundMethod
What's New in astroid 0.18.0?
=============================
Release date: 2009-03-19
* major api / tree structure changes to make it works with compiler *and*
python >= 2.5 _ast module
* cleanup and refactoring on the way
What's New in astroid 0.17.4?
=============================
Release date: 2008-11-19
* fix #6015: filter statements bug triggering W0631 false positive in pylint
* fix #5571: Function.is_method() should return False on module level
functions decorated by staticmethod/classmethod (avoid some crash in pylint)
* fix #5010: understand python 2.5 explicit relative imports
What's New in astroid 0.17.3?
=============================
Release date: 2008-09-10
* fix #5889: astng crash on certain pyreverse projects
* fix bug w/ loop assignment in .lookup
* apply Maarten patch fixing a crash on TryFinalaly.block_range and fixing
'else'/'final' block line detection
What's New in astroid 0.17.2?
=============================
Release date: 2008-01-14
* "with" statement support, patch provided by Brian Hawthorne
* fixed recursion arguments in nodes_of_class method as notified by
Dave Borowitz
* new InstanceMethod node introduced to wrap bound method (e.g. Function
node), patch provided by Dave Borowitz
What's New in astroid 0.17.1?
=============================
Release date: 2007-06-07
* fix #3651: crash when callable as default arg
* fix #3670: subscription inference crash in some cases
* fix #3673: Lambda instance has no attribute 'pytype'
* fix crash with chained "import as"
* fix crash on numpy
* fix potential InfiniteRecursion error with builtin objects
* include patch from Marien Zwart fixing some test / py 2.5
* be more error resilient when accessing living objects from external
code in the manager
What's New in astroid 0.17.0?
=============================
Release date: 2007-02-22
* api change to be able to infer using a context (used to infer function call
result only for now)
* slightly better inference on astng built from living object by trying to infer
dummy nodes (able to infer 'help' builtin for instance)
* external attribute definition support
* basic math operation inference
* new pytype method on possibly inferred node (e.g. module, classes, const...)
* fix a living object astng building bug, which was making "open" uninferable
* fix lookup of name in method bug (#3289)
* fix decorator lookup bug (#3261)
What's New in astroid 0.16.3?
=============================
Release date: 2006-11-23
* enhance inference for the subscription notation (motivated by a patch from Amaury)
and for unary sub/add
What's New in astroid 0.16.2?
=============================
Release date: 2006-11-15
* grrr, fixed python 2.3 incompatibility introduced by generator expression
scope handling
* upgrade to avoid warnings with logilab-common 0.21.0 (on which now
depends so)
* backported astutils module from logilab-common
What's New in astroid 0.16.1?
=============================
Release date: 2006-09-25
* python 2.5 support, patch provided by Marien Zwart
* fix [Class|Module].block_range method (this fixes pylint's inline
disabling of messages on classes/modules)
* handle class.__bases__ and class.__mro__ (proper metaclass handling
still needed though)
* drop python2.2 support: remove code that was working around python2.2
* fixed generator expression scope bug
* patch transformer to extract correct line information
What's New in astroid 0.16.0?
=============================
Release date: 2006-04-19
* fix living object building to consider classes such as property as
a class instead of a data descriptor
* fix multiple assignment inference which was discarding some solutions
* added some line manipulation methods to handle pylint's block messages
control feature (Node.last_source_line(), None.block_range(lineno)
What's New in astroid 0.15.1?
=============================
Release date: 2006-03-10
* fix avoiding to load everything from living objects... Thanks Amaury!
* fix a possible NameError in Instance.infer_call_result
What's New in astroid 0.15.0?
=============================
Release date: 2006-03-06
* fix possible infinite recursion on global statements (close #10342)
and in various other cases...
* fix locals/globals interactions when the global statement is used
(close #10434)
* multiple inference related bug fixes
* associate List, Tuple and Dict and Const nodes to their respective
classes
* new .ass_type method on assignment related node, returning the
assignment type node (Assign, For, ListCompFor, GenExprFor,
TryExcept)
* more API refactoring... .resolve method has disappeared, now you
have .ilookup on every nodes and .getattr/.igetattr on node
supporting the attribute protocol
* introduced a YES object that may be returned when there is ambiguity
on an inference path (typically function call when we don't know
arguments value)
* builder try to instantiate builtin exceptions subclasses to get their
instance attribute
What's New in astroid 0.14.0?
=============================
Release date: 2006-01-10
* some major inference improvements and refactoring ! The drawback is
the introduction of some non backward compatible change in the API
but it's imho much cleaner and powerful now :)
* new boolean property .newstyle on Class nodes (implements #10073)
* new .import_module method on Module node to help in .resolve
refactoring
* .instance_attrs has list of assignments to instance attribute
dictionary as value instead of one
* added missing GenExprIf and GenExprInner nodes, and implements
as_string for each generator expression related nodes
* specifically catch KeyboardInterrupt to reraise it in some places
* fix so that module names are always absolute
* fix .resolve on package where a subpackage is imported in the
__init__ file
* fix a bug regarding construction of Function node from living object
with earlier version of python 2.4
* fix a NameError on Import and From self_resolve method
* fix a bug occurring when building an astng from a living object with
a property
* lint fixes
What's New in astroid 0.13.1?
=============================
Release date: 2005-11-07
* fix bug on building from living module the same object in
encountered more than once time (e.g. builtins.object) (close #10069)
* fix bug in Class.ancestors() regarding inner classes (close #10072)
* fix .self_resolve() on From and Module nodes to handle package
precedence over module (close #10066)
* locals dict for package contains __path__ definition (close #10065)
* astng provide GenExpr and GenExprFor nodes with python >= 2.4
(close #10063)
* fix python2.2 compatibility (close #9922)
* link .__contains__ to .has_key on scoped node to speed up execution
* remove no more necessary .module_object() method on From and Module
nodes
* normalize parser.ParserError to SyntaxError with python 2.2
What's New in astroid 0.13.0?
=============================
Release date: 2005-10-21
* .locals and .globals on scoped node handle now a list of references
to each assignment statements instead of a single reference to the
first assignment statement.
* fix bug with manager.astng_from_module_name when a context file is
given (notably fix ZODB 3.4 crash with pylint/pyreverse)
* fix Compare.as_string method
* fix bug with lambda object missing the "type" attribute
* some minor refactoring
* This package has been extracted from the logilab-common package, which
will be kept for some time for backward compatibility but will no
longer be maintained (this explains that this package is starting with
the 0.13 version number, since the fork occurs with the version
released in logilab-common 0.12).
|