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
|
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Changes in previous versions — Python-Future documentation</title>
<link rel="stylesheet" href="_static/basic.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/my-styles.css" type="text/css" />
<link rel="stylesheet" href="_static/bootswatch-3.3.4/cerulean/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="_static/js/jquery-fix.js"></script>
<script type="text/javascript" src="_static/bootstrap-3.3.4/js/bootstrap.min.js"></script>
<script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>
<link rel="shortcut icon" href="_static/python-future-icon-32.ico"/>
<link rel="top" title="Python-Future documentation" href="index.html" />
<link rel="next" title="Licensing and credits" href="credits.html" />
<link rel="prev" title="Older interfaces" href="older_interfaces.html" />
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
<meta name="apple-mobile-web-app-capable" content="yes">
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-19344199-2']);
_gaq.push(['_trackPageview']);
</script>
</head>
<body role="document">
<a href="https://github.com/PythonCharmers/python-future"><img style="position: absolute; top: 45px; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png" alt="Fork me on GitHub"></a>
<div id="navbar" class="navbar navbar-inverse navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<!-- .btn-navbar is used as the toggle for collapsed navbar content -->
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="logo"> <img height="32" width="32" src="_static/python-future-logo-textless-transparent.png" /></a>
<a class="navbar-brand" href="index.html">Python-Future</a>
<span class="navbar-text navbar-version pull-left"><b></b></span>
</div>
<div class="collapse navbar-collapse nav-collapse">
<ul class="nav navbar-nav">
<li class="divider-vertical"></li>
<li><a href="overview.html">Overview</a></li>
<li><a href="compatible_idioms.html">Cheat Sheet</a></li>
<li><a href="faq.html">FAQ</a></li>
<li class="dropdown globaltoc-container">
<a role="button"
id="dLabelGlobalToc"
data-toggle="dropdown"
data-target="#"
href="index.html">Contents <b class="caret"></b></a>
<ul class="dropdown-menu globaltoc"
role="menu"
aria-labelledby="dLabelGlobalToc"><ul class="current">
<li class="toctree-l1"><a class="reference internal" href="whatsnew.html">What’s New</a><ul>
<li class="toctree-l2"><a class="reference internal" href="whatsnew.html#what-s-new-in-version-0-15-0-2015-07-25">What’s new in version 0.15.0 (2015-07-25)</a></li>
<li class="toctree-l2"><a class="reference internal" href="whatsnew.html#what-s-new-in-version-0-14-3-2014-12-15">What’s new in version 0.14.3 (2014-12-15)</a></li>
<li class="toctree-l2"><a class="reference internal" href="whatsnew.html#what-s-new-in-version-0-14-2-2014-11-21">What’s new in version 0.14.2 (2014-11-21)</a></li>
<li class="toctree-l2"><a class="reference internal" href="whatsnew.html#what-s-new-in-version-0-14-1-2014-10-02">What’s new in version 0.14.1 (2014-10-02)</a></li>
<li class="toctree-l2"><a class="reference internal" href="whatsnew.html#what-s-new-in-version-0-14-2014-10-02">What’s new in version 0.14 (2014-10-02)</a><ul>
<li class="toctree-l3"><a class="reference internal" href="whatsnew.html#bug-fixes">Bug fixes</a></li>
<li class="toctree-l3"><a class="reference internal" href="whatsnew.html#internal-cleanups">Internal cleanups</a></li>
<li class="toctree-l3"><a class="reference internal" href="whatsnew.html#deprecations">Deprecations</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="whatsnew.html#previous-versions">Previous versions</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="overview.html">Overview: Easy, clean, reliable Python 2/3 compatibility</a><ul>
<li class="toctree-l2"><a class="reference internal" href="overview.html#features">Features</a></li>
<li class="toctree-l2"><a class="reference internal" href="overview.html#code-examples">Code examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="overview.html#automatic-conversion-to-py2-3-compatible-code">Automatic conversion to Py2/3-compatible code</a><ul>
<li class="toctree-l3"><a class="reference internal" href="overview.html#futurize-2-to-both">Futurize: 2 to both</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="overview.html#automatic-translation">Automatic translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="overview.html#licensing">Licensing</a></li>
<li class="toctree-l2"><a class="reference internal" href="overview.html#next-steps">Next steps</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html">Quick-start guide</a><ul>
<li class="toctree-l2"><a class="reference internal" href="quickstart.html#installation">Installation</a></li>
<li class="toctree-l2"><a class="reference internal" href="quickstart.html#if-you-are-writing-code-from-scratch">If you are writing code from scratch</a></li>
<li class="toctree-l2"><a class="reference internal" href="quickstart.html#to-convert-existing-python-3-code">To convert existing Python 3 code</a></li>
<li class="toctree-l2"><a class="reference internal" href="quickstart.html#to-convert-existing-python-2-code">To convert existing Python 2 code</a></li>
<li class="toctree-l2"><a class="reference internal" href="quickstart.html#standard-library-reorganization">Standard library reorganization</a></li>
<li class="toctree-l2"><a class="reference internal" href="quickstart.html#python-2-only-dependencies">Python 2-only dependencies</a></li>
<li class="toctree-l2"><a class="reference internal" href="quickstart.html#next-steps">Next steps</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="compatible_idioms.html">Cheat Sheet: Writing Python 2-3 compatible code</a><ul>
<li class="toctree-l2"><a class="reference internal" href="compatible_idioms.html#setup">Setup</a></li>
<li class="toctree-l2"><a class="reference internal" href="compatible_idioms.html#essential-syntax-differences">Essential syntax differences</a><ul>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#print">print</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#raising-exceptions">Raising exceptions</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#catching-exceptions">Catching exceptions</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#division">Division</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#long-integers">Long integers</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#octal-constants">Octal constants</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#backtick-repr">Backtick repr</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#metaclasses">Metaclasses</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="compatible_idioms.html#strings-and-bytes">Strings and bytes</a><ul>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#unicode-text-string-literals">Unicode (text) string literals</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#byte-string-literals">Byte-string literals</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#basestring">basestring</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#unicode">unicode</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#stringio">StringIO</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="compatible_idioms.html#imports-relative-to-a-package">Imports relative to a package</a></li>
<li class="toctree-l2"><a class="reference internal" href="compatible_idioms.html#dictionaries">Dictionaries</a><ul>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#iterating-through-dict-keys-values-items">Iterating through <code class="docutils literal"><span class="pre">dict</span></code> keys/values/items</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#dict-keys-values-items-as-a-list">dict keys/values/items as a list</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="compatible_idioms.html#custom-class-behaviour">Custom class behaviour</a><ul>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#custom-iterators">Custom iterators</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#custom-str-methods">Custom <code class="docutils literal"><span class="pre">__str__</span></code> methods</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#custom-nonzero-vs-bool-method">Custom <code class="docutils literal"><span class="pre">__nonzero__</span></code> vs <code class="docutils literal"><span class="pre">__bool__</span></code> method:</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="compatible_idioms.html#lists-versus-iterators">Lists versus iterators</a><ul>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#xrange">xrange</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#range">range</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#map">map</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#imap">imap</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#zip-izip">zip, izip</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#filter-ifilter">filter, ifilter</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="compatible_idioms.html#other-builtins">Other builtins</a><ul>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#file-io-with-open">File IO with open()</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#reduce">reduce()</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#raw-input">raw_input()</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#input">input()</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#file">file()</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#execfile">execfile()</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#unichr">unichr()</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#intern">intern()</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#apply">apply()</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#chr">chr()</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#cmp">cmp()</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#reload">reload()</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="compatible_idioms.html#standard-library">Standard library</a><ul>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#dbm-modules">dbm modules</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#commands-subprocess-modules">commands / subprocess modules</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#subprocess-check-output">subprocess.check_output()</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#collections-counter-and-ordereddict">collections: Counter and OrderedDict</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#stringio-module">StringIO module</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#http-module">http module</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#xmlrpc-module">xmlrpc module</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#html-escaping-and-entities">html escaping and entities</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#html-parsing">html parsing</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#urllib-module">urllib module</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#tkinter">Tkinter</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#socketserver">socketserver</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#copy-reg-copyreg">copy_reg, copyreg</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#configparser">configparser</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#queue">queue</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#repr-reprlib">repr, reprlib</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#userdict-userlist-userstring">UserDict, UserList, UserString</a></li>
<li class="toctree-l3"><a class="reference internal" href="compatible_idioms.html#itertools-filterfalse-zip-longest">itertools: filterfalse, zip_longest</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="imports.html">Imports</a><ul>
<li class="toctree-l2"><a class="reference internal" href="imports.html#future-imports">__future__ imports</a></li>
<li class="toctree-l2"><a class="reference internal" href="imports.html#imports-of-builtins">Imports of builtins</a><ul>
<li class="toctree-l3"><a class="reference internal" href="imports.html#implicit-imports">Implicit imports</a></li>
<li class="toctree-l3"><a class="reference internal" href="imports.html#explicit-imports">Explicit imports</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="imports.html#standard-library-imports">Standard library imports</a><ul>
<li class="toctree-l3"><a class="reference internal" href="imports.html#direct-imports">Direct imports</a></li>
<li class="toctree-l3"><a class="reference internal" href="imports.html#aliased-imports">Aliased imports</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="imports.html#external-standard-library-backports">External standard-library backports</a></li>
<li class="toctree-l2"><a class="reference internal" href="imports.html#included-full-backports">Included full backports</a></li>
<li class="toctree-l2"><a class="reference internal" href="imports.html#using-python-2-only-dependencies-on-python-3">Using Python 2-only dependencies on Python 3</a></li>
<li class="toctree-l2"><a class="reference internal" href="imports.html#should-i-import-unicode-literals">Should I import unicode_literals?</a><ul>
<li class="toctree-l3"><a class="reference internal" href="imports.html#benefits">Benefits</a></li>
<li class="toctree-l3"><a class="reference internal" href="imports.html#drawbacks">Drawbacks</a></li>
<li class="toctree-l3"><a class="reference internal" href="imports.html#others-perspectives">Others’ perspectives</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="imports.html#next-steps">Next steps</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="what_else.html">What else you need to know</a><ul>
<li class="toctree-l2"><a class="reference internal" href="what_else.html#bytes">bytes</a></li>
<li class="toctree-l2"><a class="reference internal" href="what_else.html#str">str</a></li>
<li class="toctree-l2"><a class="reference internal" href="what_else.html#dict">dict</a><ul>
<li class="toctree-l3"><a class="reference internal" href="what_else.html#memory-efficiency-and-alternatives">Memory-efficiency and alternatives</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="what_else.html#int">int</a></li>
<li class="toctree-l2"><a class="reference internal" href="what_else.html#isinstance">isinstance</a></li>
<li class="toctree-l2"><a class="reference internal" href="what_else.html#passing-data-to-from-python-2-libraries">Passing data to/from Python 2 libraries</a></li>
<li class="toctree-l2"><a class="reference internal" href="what_else.html#native-string-type">Native string type</a></li>
<li class="toctree-l2"><a class="reference internal" href="what_else.html#open">open()</a></li>
<li class="toctree-l2"><a class="reference internal" href="what_else.html#custom-str-methods">Custom __str__ methods</a></li>
<li class="toctree-l2"><a class="reference internal" href="what_else.html#custom-iterators">Custom iterators</a></li>
<li class="toctree-l2"><a class="reference internal" href="what_else.html#binding-a-method-to-a-class">Binding a method to a class</a></li>
<li class="toctree-l2"><a class="reference internal" href="what_else.html#metaclasses">Metaclasses</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="automatic_conversion.html">Automatic conversion to Py2/3</a><ul>
<li class="toctree-l2"><a class="reference internal" href="automatic_conversion.html#futurize-py2-to-py2-3"><code class="docutils literal"><span class="pre">futurize</span></code>: Py2 to Py2/3</a><ul>
<li class="toctree-l3"><a class="reference internal" href="automatic_conversion.html#stage-1-safe-fixes">Stage 1: “safe” fixes</a></li>
<li class="toctree-l3"><a class="reference internal" href="automatic_conversion.html#stage-2-py3-style-code-with-wrappers-for-py2">Stage 2: Py3-style code with wrappers for Py2</a></li>
<li class="toctree-l3"><a class="reference internal" href="automatic_conversion.html#separating-text-from-bytes">Separating text from bytes</a></li>
<li class="toctree-l3"><a class="reference internal" href="automatic_conversion.html#post-conversion">Post-conversion</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="automatic_conversion.html#futurize-quick-start-guide"><code class="docutils literal"><span class="pre">futurize</span></code> quick-start guide</a><ul>
<li class="toctree-l3"><a class="reference internal" href="automatic_conversion.html#step-0-setup">Step 0: setup</a></li>
<li class="toctree-l3"><a class="reference internal" href="automatic_conversion.html#step-1-modern-py2-code">Step 1: modern Py2 code</a></li>
<li class="toctree-l3"><a class="reference internal" href="automatic_conversion.html#step-2-working-py3-code-that-still-supports-py2">Step 2: working Py3 code that still supports Py2</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="automatic_conversion.html#pasteurize-py3-to-py2-3"><code class="docutils literal"><span class="pre">pasteurize</span></code>: Py3 to Py2/3</a></li>
<li class="toctree-l2"><a class="reference internal" href="automatic_conversion.html#known-limitations">Known limitations</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">Frequently Asked Questions (FAQ)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="faq.html#who-is-this-for">Who is this for?</a></li>
<li class="toctree-l2"><a class="reference internal" href="faq.html#why-upgrade-to-python-3">Why upgrade to Python 3?</a></li>
<li class="toctree-l2"><a class="reference internal" href="faq.html#porting-philosophy">Porting philosophy</a><ul>
<li class="toctree-l3"><a class="reference internal" href="faq.html#why-write-python-3-style-code">Why write Python 3-style code?</a></li>
<li class="toctree-l3"><a class="reference internal" href="faq.html#can-t-i-just-roll-my-own-py2-3-compatibility-layer">Can’t I just roll my own Py2/3 compatibility layer?</a></li>
<li class="toctree-l3"><a class="reference internal" href="faq.html#what-inspired-this-project">What inspired this project?</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="faq.html#maturity">Maturity</a><ul>
<li class="toctree-l3"><a class="reference internal" href="faq.html#how-well-has-it-been-tested">How well has it been tested?</a></li>
<li class="toctree-l3"><a class="reference internal" href="faq.html#is-the-api-stable">Is the API stable?</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="faq.html#relationship-between-python-future-and-other-compatibility-tools">Relationship between python-future and other compatibility tools</a><ul>
<li class="toctree-l3"><a class="reference internal" href="faq.html#how-does-this-relate-to-2to3">How does this relate to <code class="docutils literal"><span class="pre">2to3</span></code>?</a></li>
<li class="toctree-l3"><a class="reference internal" href="faq.html#can-i-maintain-a-python-2-codebase-and-use-2to3-to-automatically-convert-to-python-3-in-the-setup-script">Can I maintain a Python 2 codebase and use 2to3 to automatically convert to Python 3 in the setup script?</a></li>
<li class="toctree-l3"><a class="reference internal" href="faq.html#what-is-the-relationship-between-future-and-six">What is the relationship between <code class="docutils literal"><span class="pre">future</span></code> and <code class="docutils literal"><span class="pre">six</span></code>?</a></li>
<li class="toctree-l3"><a class="reference internal" href="faq.html#what-is-the-relationship-between-python-future-and-python-modernize">What is the relationship between <code class="docutils literal"><span class="pre">python-future</span></code> and <code class="docutils literal"><span class="pre">python-modernize</span></code>?</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="faq.html#platform-and-version-support">Platform and version support</a><ul>
<li class="toctree-l3"><a class="reference internal" href="faq.html#which-versions-of-python-does-python-future-support">Which versions of Python does <code class="docutils literal"><span class="pre">python-future</span></code> support?</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="faq.html#support">Support</a><ul>
<li class="toctree-l3"><a class="reference internal" href="faq.html#is-there-a-mailing-list">Is there a mailing list?</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="faq.html#contributing">Contributing</a><ul>
<li class="toctree-l3"><a class="reference internal" href="faq.html#can-i-help">Can I help?</a></li>
<li class="toctree-l3"><a class="reference internal" href="faq.html#where-is-the-repo">Where is the repo?</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="stdlib_incompatibilities.html">Standard library incompatibilities</a><ul>
<li class="toctree-l2"><a class="reference internal" href="stdlib_incompatibilities.html#array-array">array.array()</a></li>
<li class="toctree-l2"><a class="reference internal" href="stdlib_incompatibilities.html#array-array-read">array.array.read()</a></li>
<li class="toctree-l2"><a class="reference internal" href="stdlib_incompatibilities.html#base64-decodebytes-and-base64-encodebytes">base64.decodebytes() and base64.encodebytes()</a></li>
<li class="toctree-l2"><a class="reference internal" href="stdlib_incompatibilities.html#re-ascii">re.ASCII</a></li>
<li class="toctree-l2"><a class="reference internal" href="stdlib_incompatibilities.html#struct-pack">struct.pack()</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="older_interfaces.html">Older interfaces</a><ul>
<li class="toctree-l2"><a class="reference internal" href="older_interfaces.html#context-manager-for-import-hooks">Context-manager for import hooks</a></li>
<li class="toctree-l2"><a class="reference internal" href="older_interfaces.html#future-moves-interface"><code class="docutils literal"><span class="pre">future.moves</span></code> interface</a><ul>
<li class="toctree-l3"><a class="reference internal" href="older_interfaces.html#comparing-future-moves-and-six-moves">Comparing future.moves and six.moves</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="older_interfaces.html#import-and-from-import-functions"><code class="docutils literal"><span class="pre">import_</span></code> and <code class="docutils literal"><span class="pre">from_import</span></code> functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="older_interfaces.html#install-hooks-call">install_hooks() call</a></li>
</ul>
</li>
<li class="toctree-l1 current"><a class="current reference internal" href="">Changes in previous versions</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#changes-in-version-0-13-1-2014-09-23">Changes in version 0.13.1 (2014-09-23)</a></li>
<li class="toctree-l2"><a class="reference internal" href="#changes-in-version-0-13-2014-08-13">Changes in version 0.13 (2014-08-13)</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#deprecations">Deprecations</a></li>
<li class="toctree-l3"><a class="reference internal" href="#new-features">New features</a></li>
<li class="toctree-l3"><a class="reference internal" href="#bug-fixes">Bug fixes</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#changes-in-version-0-12-4-2014-07-18">Changes in version 0.12.4 (2014-07-18)</a></li>
<li class="toctree-l2"><a class="reference internal" href="#changes-in-version-0-12-3-2014-06-19">Changes in version 0.12.3 (2014-06-19)</a></li>
<li class="toctree-l2"><a class="reference internal" href="#changes-in-version-0-12-2-2014-05-25">Changes in version 0.12.2 (2014-05-25)</a></li>
<li class="toctree-l2"><a class="reference internal" href="#changes-in-version-0-12-1-2014-05-14">Changes in version 0.12.1 (2014-05-14)</a></li>
<li class="toctree-l2"><a class="reference internal" href="#changes-in-version-0-12-0-2014-05-06">Changes in version 0.12.0 (2014-05-06)</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#more-robust-standard-library-import-hooks">More robust standard-library import hooks</a></li>
<li class="toctree-l3"><a class="reference internal" href="#newobject-base-object-defines-fallback-py2-compatible-special-methods"><code class="docutils literal"><span class="pre">newobject</span></code> base object defines fallback Py2-compatible special methods</a></li>
<li class="toctree-l3"><a class="reference internal" href="#past-builtins-module-improved"><code class="docutils literal"><span class="pre">past.builtins</span></code> module improved</a></li>
<li class="toctree-l3"><a class="reference internal" href="#surrogateescape-error-handler"><code class="docutils literal"><span class="pre">surrogateescape</span></code> error handler</a></li>
<li class="toctree-l3"><a class="reference internal" href="#newlist-type"><code class="docutils literal"><span class="pre">newlist</span></code> type</a></li>
<li class="toctree-l3"><a class="reference internal" href="#listvalues-and-listitems"><code class="docutils literal"><span class="pre">listvalues</span></code> and <code class="docutils literal"><span class="pre">listitems</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#tests">Tests</a></li>
<li class="toctree-l3"><a class="reference internal" href="#refactoring-of-future-standard-library-future-backports">Refactoring of <code class="docutils literal"><span class="pre">future.standard_library.*</span></code> -> <code class="docutils literal"><span class="pre">future.backports</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#backported-http-server-and-urllib-modules">Backported <code class="docutils literal"><span class="pre">http.server</span></code> and <code class="docutils literal"><span class="pre">urllib</span></code> modules</a></li>
<li class="toctree-l3"><a class="reference internal" href="#internal-refactoring">Internal refactoring</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id1">Bug fixes</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#changes-in-version-0-11-4-2014-05-25">Changes in version 0.11.4 (2014-05-25)</a></li>
<li class="toctree-l2"><a class="reference internal" href="#changes-in-version-0-11-3-2014-02-27">Changes in version 0.11.3 (2014-02-27)</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#improved-compatibility-with-requests">Improved compatibility with <code class="docutils literal"><span class="pre">requests</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#conversion-scripts-explicitly-install-import-hooks">Conversion scripts explicitly install import hooks</a></li>
<li class="toctree-l3"><a class="reference internal" href="#futurize-script-no-longer-adds-unicode-literals-by-default"><code class="docutils literal"><span class="pre">futurize</span></code> script no longer adds <code class="docutils literal"><span class="pre">unicode_literals</span></code> by default</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#changes-in-version-0-11-2014-01-28">Changes in version 0.11 (2014-01-28)</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#past-package"><code class="docutils literal"><span class="pre">past</span></code> package</a></li>
<li class="toctree-l3"><a class="reference internal" href="#auto-translation-of-python-2-modules-upon-import">Auto-translation of Python 2 modules upon import</a></li>
<li class="toctree-l3"><a class="reference internal" href="#separate-pasteurize-script">Separate <code class="docutils literal"><span class="pre">pasteurize</span></code> script</a></li>
<li class="toctree-l3"><a class="reference internal" href="#pow">pow()</a></li>
<li class="toctree-l3"><a class="reference internal" href="#input-no-longer-disabled-globally-on-py2">input() no longer disabled globally on Py2</a></li>
<li class="toctree-l3"><a class="reference internal" href="#deprecated-feature-auto-installation-of-standard-library-import-hooks">Deprecated feature: auto-installation of standard-library import hooks</a></li>
<li class="toctree-l3"><a class="reference internal" href="#internal-changes">Internal changes</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#changes-in-version-0-10-2-2014-01-11">Changes in version 0.10.2 (2014-01-11)</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#new-context-manager-interface-to-standard-library-hooks">New context-manager interface to standard_library hooks</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#changes-in-version-0-10-0-2013-12-02">Changes in version 0.10.0 (2013-12-02)</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#backported-dict-type">Backported <code class="docutils literal"><span class="pre">dict</span></code> type</a></li>
<li class="toctree-l3"><a class="reference internal" href="#utility-functions-raise-and-exec">Utility functions <code class="docutils literal"><span class="pre">raise_</span></code> and <code class="docutils literal"><span class="pre">exec_</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#bugfixes">Bugfixes</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#changes-in-version-0-9-2013-11-06">Changes in version 0.9 (2013-11-06)</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#isinstance-checks-are-supported-natively-with-backported-types"><code class="docutils literal"><span class="pre">isinstance</span></code> checks are supported natively with backported types</a></li>
<li class="toctree-l3"><a class="reference internal" href="#futurize-minimal-imports-by-default"><code class="docutils literal"><span class="pre">futurize</span></code>: minimal imports by default</a></li>
<li class="toctree-l3"><a class="reference internal" href="#looser-type-checking-for-the-backported-str-object">Looser type-checking for the backported <code class="docutils literal"><span class="pre">str</span></code> object</a></li>
<li class="toctree-l3"><a class="reference internal" href="#suspend-hooks-context-manager-added-to-future-standard-library">suspend_hooks() context manager added to <code class="docutils literal"><span class="pre">future.standard_library</span></code></a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#changes-in-version-0-8-2013-10-28">Changes in version 0.8 (2013-10-28)</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#python-2-6-support">Python 2.6 support</a></li>
<li class="toctree-l3"><a class="reference internal" href="#unused-modules-removed">Unused modules removed</a></li>
<li class="toctree-l3"><a class="reference internal" href="#isinstance-added-to-future-builtins-v0-8-2">isinstance() added to <code class="docutils literal"><span class="pre">future.builtins</span></code> (v0.8.2)</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#summary-of-all-changes">Summary of all changes</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="credits.html">Licensing and credits</a><ul>
<li class="toctree-l2"><a class="reference internal" href="credits.html#licence">Licence</a></li>
<li class="toctree-l2"><a class="reference internal" href="credits.html#sponsor">Sponsor</a></li>
<li class="toctree-l2"><a class="reference internal" href="credits.html#authors">Authors</a><ul>
<li class="toctree-l3"><a class="reference internal" href="credits.html#development-lead">Development Lead</a></li>
<li class="toctree-l3"><a class="reference internal" href="credits.html#patches">Patches</a></li>
<li class="toctree-l3"><a class="reference internal" href="credits.html#suggestions-and-feedback">Suggestions and Feedback</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="credits.html#other-credits">Other Credits</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="reference.html">API Reference (in progress)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="reference.html#module-future.builtins">future.builtins Interface</a></li>
<li class="toctree-l2"><a class="reference internal" href="reference.html#module-future.types">Backported types from Python 3</a><ul>
<li class="toctree-l3"><a class="reference internal" href="reference.html#for-more-information">For more information:</a></li>
<li class="toctree-l3"><a class="reference internal" href="reference.html#range">range()</a></li>
<li class="toctree-l3"><a class="reference internal" href="reference.html#super">super()</a></li>
<li class="toctree-l3"><a class="reference internal" href="reference.html#round">round()</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="reference.html#module-future.standard_library">future.standard_library Interface</a><ul>
<li class="toctree-l3"><a class="reference internal" href="reference.html#limitations">Limitations</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="reference.html#module-future.utils">future.utils Interface</a></li>
<li class="toctree-l2"><a class="reference internal" href="reference.html#module-past.builtins">past.builtins Interface</a></li>
<li class="toctree-l2"><a class="reference internal" href="reference.html#module-past.types">Forward-ported types from Python 2</a></li>
</ul>
</li>
</ul>
</ul>
</li>
<li class="dropdown">
<a role="button"
id="dLabelLocalToc"
data-toggle="dropdown"
data-target="#"
href="#">Page <b class="caret"></b></a>
<ul class="dropdown-menu localtoc"
role="menu"
aria-labelledby="dLabelLocalToc"><ul>
<li><a class="reference internal" href="#">Changes in previous versions</a><ul>
<li><a class="reference internal" href="#changes-in-version-0-13-1-2014-09-23">Changes in version 0.13.1 (2014-09-23)</a></li>
<li><a class="reference internal" href="#changes-in-version-0-13-2014-08-13">Changes in version 0.13 (2014-08-13)</a><ul>
<li><a class="reference internal" href="#deprecations">Deprecations</a></li>
<li><a class="reference internal" href="#new-features">New features</a></li>
<li><a class="reference internal" href="#bug-fixes">Bug fixes</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-0-12-4-2014-07-18">Changes in version 0.12.4 (2014-07-18)</a></li>
<li><a class="reference internal" href="#changes-in-version-0-12-3-2014-06-19">Changes in version 0.12.3 (2014-06-19)</a></li>
<li><a class="reference internal" href="#changes-in-version-0-12-2-2014-05-25">Changes in version 0.12.2 (2014-05-25)</a></li>
<li><a class="reference internal" href="#changes-in-version-0-12-1-2014-05-14">Changes in version 0.12.1 (2014-05-14)</a></li>
<li><a class="reference internal" href="#changes-in-version-0-12-0-2014-05-06">Changes in version 0.12.0 (2014-05-06)</a><ul>
<li><a class="reference internal" href="#more-robust-standard-library-import-hooks">More robust standard-library import hooks</a></li>
<li><a class="reference internal" href="#newobject-base-object-defines-fallback-py2-compatible-special-methods"><code class="docutils literal"><span class="pre">newobject</span></code> base object defines fallback Py2-compatible special methods</a></li>
<li><a class="reference internal" href="#past-builtins-module-improved"><code class="docutils literal"><span class="pre">past.builtins</span></code> module improved</a></li>
<li><a class="reference internal" href="#surrogateescape-error-handler"><code class="docutils literal"><span class="pre">surrogateescape</span></code> error handler</a></li>
<li><a class="reference internal" href="#newlist-type"><code class="docutils literal"><span class="pre">newlist</span></code> type</a></li>
<li><a class="reference internal" href="#listvalues-and-listitems"><code class="docutils literal"><span class="pre">listvalues</span></code> and <code class="docutils literal"><span class="pre">listitems</span></code></a></li>
<li><a class="reference internal" href="#tests">Tests</a></li>
<li><a class="reference internal" href="#refactoring-of-future-standard-library-future-backports">Refactoring of <code class="docutils literal"><span class="pre">future.standard_library.*</span></code> -> <code class="docutils literal"><span class="pre">future.backports</span></code></a></li>
<li><a class="reference internal" href="#backported-http-server-and-urllib-modules">Backported <code class="docutils literal"><span class="pre">http.server</span></code> and <code class="docutils literal"><span class="pre">urllib</span></code> modules</a></li>
<li><a class="reference internal" href="#internal-refactoring">Internal refactoring</a></li>
<li><a class="reference internal" href="#id1">Bug fixes</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-0-11-4-2014-05-25">Changes in version 0.11.4 (2014-05-25)</a></li>
<li><a class="reference internal" href="#changes-in-version-0-11-3-2014-02-27">Changes in version 0.11.3 (2014-02-27)</a><ul>
<li><a class="reference internal" href="#improved-compatibility-with-requests">Improved compatibility with <code class="docutils literal"><span class="pre">requests</span></code></a></li>
<li><a class="reference internal" href="#conversion-scripts-explicitly-install-import-hooks">Conversion scripts explicitly install import hooks</a></li>
<li><a class="reference internal" href="#futurize-script-no-longer-adds-unicode-literals-by-default"><code class="docutils literal"><span class="pre">futurize</span></code> script no longer adds <code class="docutils literal"><span class="pre">unicode_literals</span></code> by default</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-0-11-2014-01-28">Changes in version 0.11 (2014-01-28)</a><ul>
<li><a class="reference internal" href="#past-package"><code class="docutils literal"><span class="pre">past</span></code> package</a></li>
<li><a class="reference internal" href="#auto-translation-of-python-2-modules-upon-import">Auto-translation of Python 2 modules upon import</a></li>
<li><a class="reference internal" href="#separate-pasteurize-script">Separate <code class="docutils literal"><span class="pre">pasteurize</span></code> script</a></li>
<li><a class="reference internal" href="#pow">pow()</a></li>
<li><a class="reference internal" href="#input-no-longer-disabled-globally-on-py2">input() no longer disabled globally on Py2</a></li>
<li><a class="reference internal" href="#deprecated-feature-auto-installation-of-standard-library-import-hooks">Deprecated feature: auto-installation of standard-library import hooks</a></li>
<li><a class="reference internal" href="#internal-changes">Internal changes</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-0-10-2-2014-01-11">Changes in version 0.10.2 (2014-01-11)</a><ul>
<li><a class="reference internal" href="#new-context-manager-interface-to-standard-library-hooks">New context-manager interface to standard_library hooks</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-0-10-0-2013-12-02">Changes in version 0.10.0 (2013-12-02)</a><ul>
<li><a class="reference internal" href="#backported-dict-type">Backported <code class="docutils literal"><span class="pre">dict</span></code> type</a></li>
<li><a class="reference internal" href="#utility-functions-raise-and-exec">Utility functions <code class="docutils literal"><span class="pre">raise_</span></code> and <code class="docutils literal"><span class="pre">exec_</span></code></a></li>
<li><a class="reference internal" href="#bugfixes">Bugfixes</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-0-9-2013-11-06">Changes in version 0.9 (2013-11-06)</a><ul>
<li><a class="reference internal" href="#isinstance-checks-are-supported-natively-with-backported-types"><code class="docutils literal"><span class="pre">isinstance</span></code> checks are supported natively with backported types</a></li>
<li><a class="reference internal" href="#futurize-minimal-imports-by-default"><code class="docutils literal"><span class="pre">futurize</span></code>: minimal imports by default</a></li>
<li><a class="reference internal" href="#looser-type-checking-for-the-backported-str-object">Looser type-checking for the backported <code class="docutils literal"><span class="pre">str</span></code> object</a></li>
<li><a class="reference internal" href="#suspend-hooks-context-manager-added-to-future-standard-library">suspend_hooks() context manager added to <code class="docutils literal"><span class="pre">future.standard_library</span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes-in-version-0-8-2013-10-28">Changes in version 0.8 (2013-10-28)</a><ul>
<li><a class="reference internal" href="#python-2-6-support">Python 2.6 support</a></li>
<li><a class="reference internal" href="#unused-modules-removed">Unused modules removed</a></li>
<li><a class="reference internal" href="#isinstance-added-to-future-builtins-v0-8-2">isinstance() added to <code class="docutils literal"><span class="pre">future.builtins</span></code> (v0.8.2)</a></li>
</ul>
</li>
<li><a class="reference internal" href="#summary-of-all-changes">Summary of all changes</a></li>
</ul>
</li>
</ul>
</ul>
</li>
</ul>
<form class="navbar-form navbar-right" action="search.html" method="get">
<div class="form-group">
<input type="text" name="q" class="form-control" placeholder="Search" />
</div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-3">
<div id="sidebar" class="bs-sidenav" role="complementary"><!--<h3>Python-Future</h3>
<p>-->
<h4>Easy, clean, reliable Python 2/3 compatibility</h4>
<a href="http://python-future.org">Table of Contents</a>
<!--
</p>
<h3>Other Formats</h3>
<p>
You can download the documentation in other formats as well:
</p>
<ul>
<li><a href="http://jinja.pocoo.org/docs/jinja-docs.pdf">as PDF</a>
<li><a href="http://jinja.pocoo.org/docs/jinja-docs.zip">as zipped HTML</a>
</ul>
-->
<!--<h3>Useful Links</h3>
<ul>
<li><a href="http://pypi.python.org/pypi/future">on PyPI</a></li>
<li><a href="https://github.com/PythonCharmers/python-future">on GitHub</a></li>
</ul>
--><ul class="current">
<li class="toctree-l1"><a class="reference internal" href="whatsnew.html">What’s New</a></li>
<li class="toctree-l1"><a class="reference internal" href="overview.html">Overview: Easy, clean, reliable Python 2/3 compatibility</a></li>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html">Quick-start guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="compatible_idioms.html">Cheat Sheet: Writing Python 2-3 compatible code</a></li>
<li class="toctree-l1"><a class="reference internal" href="imports.html">Imports</a></li>
<li class="toctree-l1"><a class="reference internal" href="what_else.html">What else you need to know</a></li>
<li class="toctree-l1"><a class="reference internal" href="automatic_conversion.html">Automatic conversion to Py2/3</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">Frequently Asked Questions (FAQ)</a></li>
<li class="toctree-l1"><a class="reference internal" href="stdlib_incompatibilities.html">Standard library incompatibilities</a></li>
<li class="toctree-l1"><a class="reference internal" href="older_interfaces.html">Older interfaces</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="">Changes in previous versions</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#changes-in-version-0-13-1-2014-09-23">Changes in version 0.13.1 (2014-09-23)</a></li>
<li class="toctree-l2"><a class="reference internal" href="#changes-in-version-0-13-2014-08-13">Changes in version 0.13 (2014-08-13)</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#deprecations">Deprecations</a></li>
<li class="toctree-l3"><a class="reference internal" href="#new-features">New features</a></li>
<li class="toctree-l3"><a class="reference internal" href="#bug-fixes">Bug fixes</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#changes-in-version-0-12-4-2014-07-18">Changes in version 0.12.4 (2014-07-18)</a></li>
<li class="toctree-l2"><a class="reference internal" href="#changes-in-version-0-12-3-2014-06-19">Changes in version 0.12.3 (2014-06-19)</a></li>
<li class="toctree-l2"><a class="reference internal" href="#changes-in-version-0-12-2-2014-05-25">Changes in version 0.12.2 (2014-05-25)</a></li>
<li class="toctree-l2"><a class="reference internal" href="#changes-in-version-0-12-1-2014-05-14">Changes in version 0.12.1 (2014-05-14)</a></li>
<li class="toctree-l2"><a class="reference internal" href="#changes-in-version-0-12-0-2014-05-06">Changes in version 0.12.0 (2014-05-06)</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#more-robust-standard-library-import-hooks">More robust standard-library import hooks</a></li>
<li class="toctree-l3"><a class="reference internal" href="#newobject-base-object-defines-fallback-py2-compatible-special-methods"><code class="docutils literal"><span class="pre">newobject</span></code> base object defines fallback Py2-compatible special methods</a></li>
<li class="toctree-l3"><a class="reference internal" href="#past-builtins-module-improved"><code class="docutils literal"><span class="pre">past.builtins</span></code> module improved</a></li>
<li class="toctree-l3"><a class="reference internal" href="#surrogateescape-error-handler"><code class="docutils literal"><span class="pre">surrogateescape</span></code> error handler</a></li>
<li class="toctree-l3"><a class="reference internal" href="#newlist-type"><code class="docutils literal"><span class="pre">newlist</span></code> type</a></li>
<li class="toctree-l3"><a class="reference internal" href="#listvalues-and-listitems"><code class="docutils literal"><span class="pre">listvalues</span></code> and <code class="docutils literal"><span class="pre">listitems</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#tests">Tests</a></li>
<li class="toctree-l3"><a class="reference internal" href="#refactoring-of-future-standard-library-future-backports">Refactoring of <code class="docutils literal"><span class="pre">future.standard_library.*</span></code> -> <code class="docutils literal"><span class="pre">future.backports</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#backported-http-server-and-urllib-modules">Backported <code class="docutils literal"><span class="pre">http.server</span></code> and <code class="docutils literal"><span class="pre">urllib</span></code> modules</a></li>
<li class="toctree-l3"><a class="reference internal" href="#internal-refactoring">Internal refactoring</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id1">Bug fixes</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#changes-in-version-0-11-4-2014-05-25">Changes in version 0.11.4 (2014-05-25)</a></li>
<li class="toctree-l2"><a class="reference internal" href="#changes-in-version-0-11-3-2014-02-27">Changes in version 0.11.3 (2014-02-27)</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#improved-compatibility-with-requests">Improved compatibility with <code class="docutils literal"><span class="pre">requests</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#conversion-scripts-explicitly-install-import-hooks">Conversion scripts explicitly install import hooks</a></li>
<li class="toctree-l3"><a class="reference internal" href="#futurize-script-no-longer-adds-unicode-literals-by-default"><code class="docutils literal"><span class="pre">futurize</span></code> script no longer adds <code class="docutils literal"><span class="pre">unicode_literals</span></code> by default</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#changes-in-version-0-11-2014-01-28">Changes in version 0.11 (2014-01-28)</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#past-package"><code class="docutils literal"><span class="pre">past</span></code> package</a></li>
<li class="toctree-l3"><a class="reference internal" href="#auto-translation-of-python-2-modules-upon-import">Auto-translation of Python 2 modules upon import</a></li>
<li class="toctree-l3"><a class="reference internal" href="#separate-pasteurize-script">Separate <code class="docutils literal"><span class="pre">pasteurize</span></code> script</a></li>
<li class="toctree-l3"><a class="reference internal" href="#pow">pow()</a></li>
<li class="toctree-l3"><a class="reference internal" href="#input-no-longer-disabled-globally-on-py2">input() no longer disabled globally on Py2</a></li>
<li class="toctree-l3"><a class="reference internal" href="#deprecated-feature-auto-installation-of-standard-library-import-hooks">Deprecated feature: auto-installation of standard-library import hooks</a></li>
<li class="toctree-l3"><a class="reference internal" href="#internal-changes">Internal changes</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#changes-in-version-0-10-2-2014-01-11">Changes in version 0.10.2 (2014-01-11)</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#new-context-manager-interface-to-standard-library-hooks">New context-manager interface to standard_library hooks</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#changes-in-version-0-10-0-2013-12-02">Changes in version 0.10.0 (2013-12-02)</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#backported-dict-type">Backported <code class="docutils literal"><span class="pre">dict</span></code> type</a></li>
<li class="toctree-l3"><a class="reference internal" href="#utility-functions-raise-and-exec">Utility functions <code class="docutils literal"><span class="pre">raise_</span></code> and <code class="docutils literal"><span class="pre">exec_</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#bugfixes">Bugfixes</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#changes-in-version-0-9-2013-11-06">Changes in version 0.9 (2013-11-06)</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#isinstance-checks-are-supported-natively-with-backported-types"><code class="docutils literal"><span class="pre">isinstance</span></code> checks are supported natively with backported types</a></li>
<li class="toctree-l3"><a class="reference internal" href="#futurize-minimal-imports-by-default"><code class="docutils literal"><span class="pre">futurize</span></code>: minimal imports by default</a></li>
<li class="toctree-l3"><a class="reference internal" href="#looser-type-checking-for-the-backported-str-object">Looser type-checking for the backported <code class="docutils literal"><span class="pre">str</span></code> object</a></li>
<li class="toctree-l3"><a class="reference internal" href="#suspend-hooks-context-manager-added-to-future-standard-library">suspend_hooks() context manager added to <code class="docutils literal"><span class="pre">future.standard_library</span></code></a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#changes-in-version-0-8-2013-10-28">Changes in version 0.8 (2013-10-28)</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#python-2-6-support">Python 2.6 support</a></li>
<li class="toctree-l3"><a class="reference internal" href="#unused-modules-removed">Unused modules removed</a></li>
<li class="toctree-l3"><a class="reference internal" href="#isinstance-added-to-future-builtins-v0-8-2">isinstance() added to <code class="docutils literal"><span class="pre">future.builtins</span></code> (v0.8.2)</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#summary-of-all-changes">Summary of all changes</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="credits.html">Licensing and credits</a></li>
<li class="toctree-l1"><a class="reference internal" href="reference.html">API Reference (in progress)</a></li>
</ul>
</div>
</div>
<div class="col-md-9">
<div class="section" id="changes-in-previous-versions">
<span id="whats-old"></span><h1>Changes in previous versions<a class="headerlink" href="#changes-in-previous-versions" title="Permalink to this headline">¶</a></h1>
<p>Changes in the most recent major version are here: <a class="reference internal" href="whatsnew.html#whats-new"><span>What’s New</span></a>.</p>
<div class="section" id="changes-in-version-0-13-1-2014-09-23">
<span id="whats-new-0-13-x"></span><h2>Changes in version 0.13.1 (2014-09-23)<a class="headerlink" href="#changes-in-version-0-13-1-2014-09-23" title="Permalink to this headline">¶</a></h2>
<p>This is a bug-fix release:</p>
<ul class="simple">
<li>Fix (multiple) inheritance of <code class="docutils literal"><span class="pre">future.builtins.object</span></code> with metaclasses (issues #91 and #96)</li>
<li>Fix <code class="docutils literal"><span class="pre">futurize</span></code>‘s refactoring of <code class="docutils literal"><span class="pre">urllib</span></code> imports (issue #94)</li>
<li>Fix <code class="docutils literal"><span class="pre">futurize</span> <span class="pre">--all-imports</span></code> (issue #101)</li>
<li>Fix <code class="docutils literal"><span class="pre">futurize</span> <span class="pre">--output-dir</span></code> logging (issue #102)</li>
<li>Doc formatting fix (issues #98, 100)</li>
</ul>
</div>
<div class="section" id="changes-in-version-0-13-2014-08-13">
<h2>Changes in version 0.13 (2014-08-13)<a class="headerlink" href="#changes-in-version-0-13-2014-08-13" title="Permalink to this headline">¶</a></h2>
<p>This is mostly a clean-up release. It adds some small new compatibility features
and fixes several bugs.</p>
<div class="section" id="deprecations">
<h3>Deprecations<a class="headerlink" href="#deprecations" title="Permalink to this headline">¶</a></h3>
<p>The following unused internal modules are now deprecated. They will be removed in a
future release:</p>
<ul class="simple">
<li><code class="docutils literal"><span class="pre">future.utils.encoding</span></code> and <code class="docutils literal"><span class="pre">future.utils.six</span></code>.</li>
</ul>
<p>(Issue #80). See <a class="reference external" href="http://fedoraproject.org/wiki/Packaging:No_Bundled_Libraries">here</a>
for the rationale for unbundling them.</p>
</div>
<div class="section" id="new-features">
<h3>New features<a class="headerlink" href="#new-features" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li>Docs: Add <a class="reference internal" href="compatible_idioms.html#compatible-idioms"><span>Cheat Sheet: Writing Python 2-3 compatible code</span></a> from Ed Schofield’s PyConAU 2014 talk.</li>
<li>Add <code class="docutils literal"><span class="pre">newint.to_bytes()</span></code> and <code class="docutils literal"><span class="pre">newint.from_bytes()</span></code> (issue #85)</li>
<li>Add <code class="docutils literal"><span class="pre">future.utils.raise_from</span></code> as an equivalent to Py3’s <code class="docutils literal"><span class="pre">raise</span> <span class="pre">...</span> <span class="pre">from</span>
<span class="pre">...</span></code> syntax (issue #86).</li>
<li>Add <code class="docutils literal"><span class="pre">past.builtins.oct()</span></code> function.</li>
<li>Add backports for Python 2.6 of <code class="docutils literal"><span class="pre">subprocess.check_output()</span></code>,
<code class="docutils literal"><span class="pre">itertools.combinations_with_replacement()</span></code>, and <code class="docutils literal"><span class="pre">functools.cmp_to_key()</span></code>.</li>
</ul>
</div>
<div class="section" id="bug-fixes">
<h3>Bug fixes<a class="headerlink" href="#bug-fixes" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li>Use a private logger instead of the global logger in
<code class="docutils literal"><span class="pre">future.standard_library</span></code> (issue #82). This restores compatibility of the
standard library hooks with <code class="docutils literal"><span class="pre">flask</span></code> (issue #79).</li>
<li>Stage 1 of <code class="docutils literal"><span class="pre">futurize</span></code> no longer renames <code class="docutils literal"><span class="pre">next</span></code> methods to <code class="docutils literal"><span class="pre">__next__</span></code>
(issue #81). It still converts <code class="docutils literal"><span class="pre">obj.next()</span></code> method calls to
<code class="docutils literal"><span class="pre">next(obj)</span></code> correctly.</li>
<li>Prevent introduction of a second set of parentheses in <code class="docutils literal"><span class="pre">print()</span></code> calls in
some further cases.</li>
<li>Fix isinstance checks for subclasses of future types (issue #89).</li>
<li>Be explicit about encoding file contents as UTF-8 in unit tests (issue #63).
Useful for building RPMs and in other environments where <code class="docutils literal"><span class="pre">LANG=C</span></code>.</li>
<li>Fix for 3-argument <code class="docutils literal"><span class="pre">pow(x,</span> <span class="pre">y,</span> <span class="pre">z)</span></code> with <code class="docutils literal"><span class="pre">newint</span></code> arguments (issue #87).
(Thanks to @str4d).</li>
</ul>
</div>
</div>
<div class="section" id="changes-in-version-0-12-4-2014-07-18">
<span id="whats-new-0-12-4"></span><h2>Changes in version 0.12.4 (2014-07-18)<a class="headerlink" href="#changes-in-version-0-12-4-2014-07-18" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>Fix upcasting behaviour of newint (issue #76).</li>
</ul>
</div>
<div class="section" id="changes-in-version-0-12-3-2014-06-19">
<span id="whats-new-0-12-3"></span><h2>Changes in version 0.12.3 (2014-06-19)<a class="headerlink" href="#changes-in-version-0-12-3-2014-06-19" title="Permalink to this headline">¶</a></h2>
<ul>
<li><p class="first">Add “official Python 3.4 support”: Py3.4 is now listed among the PyPI Trove
classifiers and the tests now run successfully on Py3.4 (issue #67).</p>
</li>
<li><p class="first">Add backports of <code class="docutils literal"><span class="pre">collections.OrderedDict</span></code> and
<code class="docutils literal"><span class="pre">collections.Counter</span></code> for Python 2.6 (issue #52).</p>
</li>
<li><p class="first">Add <code class="docutils literal"><span class="pre">--version</span></code> option for <code class="docutils literal"><span class="pre">futurize</span></code> and <code class="docutils literal"><span class="pre">pasteurize</span></code> scripts
(issue #57).</p>
</li>
<li><p class="first">Fix <code class="docutils literal"><span class="pre">future.utils.ensure_new_type</span></code> with <code class="docutils literal"><span class="pre">long</span></code> input (issue #65).</p>
</li>
<li><p class="first">Remove some false alarms on checks for ambiguous fixer names with
<code class="docutils literal"><span class="pre">futurize</span> <span class="pre">-f</span> <span class="pre">...</span></code>.</p>
</li>
<li><dl class="first docutils">
<dt>Testing fixes:</dt>
<dd><ul class="first last simple">
<li>Don’t hard-code Python interpreter command in tests (issue #62).</li>
<li>Fix deprecated <code class="docutils literal"><span class="pre">unittest</span></code> usage in Py3 (also issue #62).</li>
<li>Be explicit about encoding temporary file contents as UTF-8 for
when LANG=C (e.g. when building an RPM) (issue #63).</li>
<li>All undecorated tests are now passing again on Python 2.6, 2.7, 3.3,
and 3.4 (thanks to Elliott Sales de Andrade).</li>
</ul>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>Docs:</dt>
<dd><ul class="first last simple">
<li>Add list of fixers used by <code class="docutils literal"><span class="pre">futurize</span></code> (issue #58).</li>
<li>Add list of contributors to the Credits page.</li>
</ul>
</dd>
</dl>
</li>
</ul>
</div>
<div class="section" id="changes-in-version-0-12-2-2014-05-25">
<span id="whats-new-0-12-2"></span><h2>Changes in version 0.12.2 (2014-05-25)<a class="headerlink" href="#changes-in-version-0-12-2-2014-05-25" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>Add <code class="docutils literal"><span class="pre">bytes.maketrans()</span></code> method (issue #51).</li>
<li>Add support for Python versions between 2.7.0 and 2.7.3 (inclusive)
(issue #53).</li>
<li>Bug fix for <code class="docutils literal"><span class="pre">newlist(newlist([1,</span> <span class="pre">2,</span> <span class="pre">3]))</span></code> (issue #50).</li>
</ul>
</div>
<div class="section" id="changes-in-version-0-12-1-2014-05-14">
<span id="whats-new-0-12-1"></span><h2>Changes in version 0.12.1 (2014-05-14)<a class="headerlink" href="#changes-in-version-0-12-1-2014-05-14" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>Python 2.6 support: <code class="docutils literal"><span class="pre">future.standard_library</span></code> now isolates the <code class="docutils literal"><span class="pre">importlib</span></code>
dependency to one function (<code class="docutils literal"><span class="pre">import_</span></code>) so the <code class="docutils literal"><span class="pre">importlib</span></code> backport may
not be needed.</li>
<li>Doc updates</li>
</ul>
</div>
<div class="section" id="changes-in-version-0-12-0-2014-05-06">
<span id="whats-new-0-12"></span><h2>Changes in version 0.12.0 (2014-05-06)<a class="headerlink" href="#changes-in-version-0-12-0-2014-05-06" title="Permalink to this headline">¶</a></h2>
<p>The major new feature in this version is improvements in the support for the
reorganized standard library (PEP 3108) and compatibility of the import
mechanism with 3rd-party modules.</p>
<div class="section" id="more-robust-standard-library-import-hooks">
<h3>More robust standard-library import hooks<a class="headerlink" href="#more-robust-standard-library-import-hooks" title="Permalink to this headline">¶</a></h3>
<p><strong>Note: backwards-incompatible change:</strong> As previously announced (see
<a class="reference internal" href="#deprecated-auto-import-hooks"><span>Deprecated feature: auto-installation of standard-library import hooks</span></a>), the import hooks must now be enabled
explicitly, as follows:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">future</span> <span class="kn">import</span> <span class="n">standard_library</span>
<span class="k">with</span> <span class="n">standard_library</span><span class="o">.</span><span class="n">hooks</span><span class="p">():</span>
<span class="kn">import</span> <span class="nn">html.parser</span>
<span class="kn">import</span> <span class="nn">http.client</span>
<span class="o">...</span>
</pre></div>
</div>
<p>This now causes these modules to be imported from <code class="docutils literal"><span class="pre">future.moves</span></code>, a new
package that provides wrappers over the native Python 2 standard library with
the new Python 3 organization. As a consequence, the import hooks provided in
<code class="docutils literal"><span class="pre">future.standard_library</span></code> are now fully compatible with the <a class="reference external" href="http://python-requests.org">Requests library</a>.</p>
<p>The functional interface with <code class="docutils literal"><span class="pre">install_hooks()</span></code> is still supported for
backwards compatibility:</p>
<div class="highlight-python"><div class="highlight"><pre>from future import standard_library
standard_library.install_hooks():
import html.parser
import http.client
...
standard_library.remove_hooks()
</pre></div>
</div>
<p>Explicit installation of import hooks allows finer-grained control
over whether they are enabled for other imported modules that provide their own
Python 2/3 compatibility layer. This also improves compatibility of <code class="docutils literal"><span class="pre">future</span></code>
with tools like <code class="docutils literal"><span class="pre">py2exe</span></code>.</p>
</div>
<div class="section" id="newobject-base-object-defines-fallback-py2-compatible-special-methods">
<h3><code class="docutils literal"><span class="pre">newobject</span></code> base object defines fallback Py2-compatible special methods<a class="headerlink" href="#newobject-base-object-defines-fallback-py2-compatible-special-methods" title="Permalink to this headline">¶</a></h3>
<p>There is a new <code class="docutils literal"><span class="pre">future.types.newobject</span></code> base class (available as
<code class="docutils literal"><span class="pre">future.builtins.object</span></code>) that can streamline Py2/3 compatible code by
providing fallback Py2-compatible special methods for its subclasses. It
currently provides <code class="docutils literal"><span class="pre">next()</span></code> and <code class="docutils literal"><span class="pre">__nonzero__()</span></code> as fallback methods on Py2
when its subclasses define the corresponding Py3-style <code class="docutils literal"><span class="pre">__next__()</span></code> and
<code class="docutils literal"><span class="pre">__bool__()</span></code> methods.</p>
<p>This obviates the need to add certain compatibility hacks or decorators to the
code such as the <code class="docutils literal"><span class="pre">@implements_iterator</span></code> decorator for classes that define a
Py3-style <code class="docutils literal"><span class="pre">__next__</span></code> method.</p>
<p>In this example, the code defines a Py3-style iterator with a <code class="docutils literal"><span class="pre">__next__</span></code>
method. The <code class="docutils literal"><span class="pre">object</span></code> class defines a <code class="docutils literal"><span class="pre">next</span></code> method for Python 2 that maps
to <code class="docutils literal"><span class="pre">__next__</span></code>:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">future.builtins</span> <span class="kn">import</span> <span class="nb">object</span>
<span class="k">class</span> <span class="nc">Upper</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">iterable</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_iter</span> <span class="o">=</span> <span class="nb">iter</span><span class="p">(</span><span class="n">iterable</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">__next__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> <span class="c"># note the Py3 interface</span>
<span class="k">return</span> <span class="nb">next</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_iter</span><span class="p">)</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span>
<span class="k">def</span> <span class="nf">__iter__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="bp">self</span>
<span class="k">assert</span> <span class="nb">list</span><span class="p">(</span><span class="n">Upper</span><span class="p">(</span><span class="s">'hello'</span><span class="p">))</span> <span class="o">==</span> <span class="nb">list</span><span class="p">(</span><span class="s">'HELLO'</span><span class="p">)</span>
</pre></div>
</div>
<p><code class="docutils literal"><span class="pre">newobject</span></code> defines other Py2-compatible special methods similarly:
currently these include <code class="docutils literal"><span class="pre">__nonzero__</span></code> (mapped to <code class="docutils literal"><span class="pre">__bool__</span></code>) and
<code class="docutils literal"><span class="pre">__long__</span></code> (mapped to <code class="docutils literal"><span class="pre">__int__</span></code>).</p>
<p>Inheriting from <code class="docutils literal"><span class="pre">newobject</span></code> on Python 2 is safe even if your class defines
its own Python 2-style <code class="docutils literal"><span class="pre">__nonzero__</span></code> and <code class="docutils literal"><span class="pre">next</span></code> and <code class="docutils literal"><span class="pre">__long__</span></code> methods.
Your custom methods will simply override those on the base class.</p>
<p>On Python 3, as usual, <code class="docutils literal"><span class="pre">future.builtins.object</span></code> simply refers to <code class="docutils literal"><span class="pre">builtins.object</span></code>.</p>
</div>
<div class="section" id="past-builtins-module-improved">
<h3><code class="docutils literal"><span class="pre">past.builtins</span></code> module improved<a class="headerlink" href="#past-builtins-module-improved" title="Permalink to this headline">¶</a></h3>
<p>The <code class="docutils literal"><span class="pre">past.builtins</span></code> module is much more compatible with the corresponding
builtins on Python 2; many more of the Py2 unit tests pass on Py3. For example,
functions like <code class="docutils literal"><span class="pre">map()</span></code> and <code class="docutils literal"><span class="pre">filter()</span></code> now behave as they do on Py2 with with
<code class="docutils literal"><span class="pre">None</span></code> as the first argument.</p>
<p>The <code class="docutils literal"><span class="pre">past.builtins</span></code> module has also been extended to add Py3 support for
additional Py2 constructs that are not adequately handled by <code class="docutils literal"><span class="pre">lib2to3</span></code> (see
issue #37). This includes new <code class="docutils literal"><span class="pre">execfile()</span></code> and <code class="docutils literal"><span class="pre">cmp()</span></code> functions.
<code class="docutils literal"><span class="pre">futurize</span></code> now invokes imports of these functions from <code class="docutils literal"><span class="pre">past.builtins</span></code>.</p>
</div>
<div class="section" id="surrogateescape-error-handler">
<h3><code class="docutils literal"><span class="pre">surrogateescape</span></code> error handler<a class="headerlink" href="#surrogateescape-error-handler" title="Permalink to this headline">¶</a></h3>
<p>The <code class="docutils literal"><span class="pre">newstr</span></code> type (<code class="docutils literal"><span class="pre">future.builtins.str</span></code>) now supports a backport of the
Py3.x <code class="docutils literal"><span class="pre">'surrogateescape'</span></code> error handler for preserving high-bit
characters when encoding and decoding strings with unknown encodings.</p>
</div>
<div class="section" id="newlist-type">
<h3><code class="docutils literal"><span class="pre">newlist</span></code> type<a class="headerlink" href="#newlist-type" title="Permalink to this headline">¶</a></h3>
<p>There is a new <code class="docutils literal"><span class="pre">list</span></code> type in <code class="docutils literal"><span class="pre">future.builtins</span></code> that offers <code class="docutils literal"><span class="pre">.copy()</span></code> and
<code class="docutils literal"><span class="pre">.clear()</span></code> methods like the <code class="docutils literal"><span class="pre">list</span></code> type in Python 3.</p>
</div>
<div class="section" id="listvalues-and-listitems">
<h3><code class="docutils literal"><span class="pre">listvalues</span></code> and <code class="docutils literal"><span class="pre">listitems</span></code><a class="headerlink" href="#listvalues-and-listitems" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal"><span class="pre">future.utils</span></code> now contains helper functions <code class="docutils literal"><span class="pre">listvalues</span></code> and
<code class="docutils literal"><span class="pre">listitems</span></code>, which provide Python 2-style list snapshotting semantics for
dictionaries in both Python 2 and Python 3.</p>
<p>These came out of the discussion around Nick Coghlan’s now-withdrawn PEP 469.</p>
<p>There is no corresponding <code class="docutils literal"><span class="pre">listkeys(d)</span></code> function. Use <code class="docutils literal"><span class="pre">list(d)</span></code> for this case.</p>
</div>
<div class="section" id="tests">
<h3>Tests<a class="headerlink" href="#tests" title="Permalink to this headline">¶</a></h3>
<p>The number of unit tests has increased from 600 to over 800. Most of the new
tests come from Python 3.3’s test suite.</p>
</div>
<div class="section" id="refactoring-of-future-standard-library-future-backports">
<h3>Refactoring of <code class="docutils literal"><span class="pre">future.standard_library.*</span></code> -> <code class="docutils literal"><span class="pre">future.backports</span></code><a class="headerlink" href="#refactoring-of-future-standard-library-future-backports" title="Permalink to this headline">¶</a></h3>
<p>The backported standard library modules have been moved to <code class="docutils literal"><span class="pre">future.backports</span></code>
to make the distinction clearer between these and the new <code class="docutils literal"><span class="pre">future.moves</span></code>
package.</p>
</div>
<div class="section" id="backported-http-server-and-urllib-modules">
<h3>Backported <code class="docutils literal"><span class="pre">http.server</span></code> and <code class="docutils literal"><span class="pre">urllib</span></code> modules<a class="headerlink" href="#backported-http-server-and-urllib-modules" title="Permalink to this headline">¶</a></h3>
<p>Alpha versions of backports of the <code class="docutils literal"><span class="pre">http.server</span></code> and <code class="docutils literal"><span class="pre">urllib</span></code> module from
Python 3.3’s standard library are now provided in <code class="docutils literal"><span class="pre">future.backports</span></code>.</p>
<p>Use them like this:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">future.backports.urllib.request</span> <span class="kn">import</span> <span class="n">Request</span> <span class="c"># etc.</span>
<span class="kn">from</span> <span class="nn">future.backports.http</span> <span class="kn">import</span> <span class="n">server</span> <span class="k">as</span> <span class="n">http_server</span>
</pre></div>
</div>
<p>or with this new interface:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">future.standard_library</span> <span class="kn">import</span> <span class="n">import_</span><span class="p">,</span> <span class="n">from_import</span>
<span class="n">Request</span> <span class="o">=</span> <span class="n">from_import</span><span class="p">(</span><span class="s">'urllib.request'</span><span class="p">,</span> <span class="s">'Request'</span><span class="p">,</span> <span class="n">backport</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
<span class="n">http</span> <span class="o">=</span> <span class="n">import_</span><span class="p">(</span><span class="s">'http.server'</span><span class="p">,</span> <span class="n">backport</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="section" id="internal-refactoring">
<h3>Internal refactoring<a class="headerlink" href="#internal-refactoring" title="Permalink to this headline">¶</a></h3>
<p>The <code class="docutils literal"><span class="pre">future.builtins.types</span></code> module has been moved to <code class="docutils literal"><span class="pre">future.types</span></code>.
Likewise, <code class="docutils literal"><span class="pre">past.builtins.types</span></code> has been moved to <code class="docutils literal"><span class="pre">past.types</span></code>. The only
user-visible effect of this is to change <code class="docutils literal"><span class="pre">repr(type(obj))</span></code> for instances
of these types. For example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">future.builtins</span> <span class="kn">import</span> <span class="nb">bytes</span>
<span class="gp">>>> </span><span class="nb">bytes</span><span class="p">(</span><span class="n">b</span><span class="s">'abc'</span><span class="p">)</span>
<span class="gp">>>> </span><span class="nb">type</span><span class="p">(</span><span class="n">b</span><span class="p">)</span>
<span class="go">future.types.newbytes.newbytes</span>
</pre></div>
</div>
<p>instead of:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="nb">type</span><span class="p">(</span><span class="n">b</span><span class="p">)</span> <span class="c"># prior to v0.12</span>
<span class="go">future.builtins.types.newbytes.newbytes</span>
</pre></div>
</div>
</div>
<div class="section" id="id1">
<h3>Bug fixes<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h3>
<p>Many small improvements and fixes have been made across the project. Some highlights are:</p>
<ul class="simple">
<li>Fixes and updates from Python 3.3.5 have been included in the backported
standard library modules.</li>
<li>Scrubbing of the <code class="docutils literal"><span class="pre">sys.modules</span></code> cache performed by <code class="docutils literal"><span class="pre">remove_hooks()</span></code> (also
called by the <code class="docutils literal"><span class="pre">suspend_hooks</span></code> and <code class="docutils literal"><span class="pre">hooks</span></code> context managers) is now more
conservative.</li>
</ul>
<ul class="simple">
<li>The <code class="docutils literal"><span class="pre">fix_next</span></code> and <code class="docutils literal"><span class="pre">fix_reduce</span></code> fixers have been moved to stage 1 of
<code class="docutils literal"><span class="pre">futurize</span></code>.</li>
<li><code class="docutils literal"><span class="pre">futurize</span></code>: Shebang lines such as <code class="docutils literal"><span class="pre">#!/usr/bin/env</span> <span class="pre">python</span></code> and source code
file encoding declarations like <code class="docutils literal"><span class="pre">#</span> <span class="pre">-*-</span> <span class="pre">coding=utf-8</span> <span class="pre">-*-</span></code> are no longer occasionally
displaced by <code class="docutils literal"><span class="pre">from</span> <span class="pre">__future__</span> <span class="pre">import</span> <span class="pre">...</span></code> statements. (Issue #10.)</li>
<li>Improved compatibility with py2exe (<a class="reference external" href="https://github.com/PythonCharmers/python-future/issues/31">issue #31</a>).</li>
<li>The <code class="docutils literal"><span class="pre">future.utils.bytes_to_native_str</span></code> function now returns a platform-native string
object and <code class="docutils literal"><span class="pre">future.utils.native_str_to_bytes</span></code> returns a <code class="docutils literal"><span class="pre">newbytes</span></code> object on Py2.
(<a class="reference external" href="https://github.com/PythonCharmers/python-future/issues/47">Issue #47</a>).</li>
<li>The backported <code class="docutils literal"><span class="pre">http.client</span></code> module and related modules use other new
backported modules such as <code class="docutils literal"><span class="pre">email</span></code>. As a result they are more compliant
with the Python 3.3 equivalents.</li>
</ul>
</div>
</div>
<div class="section" id="changes-in-version-0-11-4-2014-05-25">
<span id="whats-new-0-11-4"></span><h2>Changes in version 0.11.4 (2014-05-25)<a class="headerlink" href="#changes-in-version-0-11-4-2014-05-25" title="Permalink to this headline">¶</a></h2>
<p>This release contains various small improvements and fixes:</p>
<ul class="simple">
<li>This release restores Python 2.6 compatibility. (Issue #42).</li>
<li>The <code class="docutils literal"><span class="pre">fix_absolute_import</span></code> fixer now supports Cython <code class="docutils literal"><span class="pre">.pyx</span></code> modules. (Issue
#35).</li>
<li>Right-division with <code class="docutils literal"><span class="pre">newint</span></code> objects is fixed. (Issue #38).</li>
<li>The <code class="docutils literal"><span class="pre">fix_dict</span></code> fixer has been moved to stage2 of <code class="docutils literal"><span class="pre">futurize</span></code>.</li>
<li>Calls to <code class="docutils literal"><span class="pre">bytes(string,</span> <span class="pre">encoding[,</span> <span class="pre">errors])</span></code> now work with <code class="docutils literal"><span class="pre">encoding</span></code> and
<code class="docutils literal"><span class="pre">errors</span></code> passed as positional arguments. Previously this only worked if
<code class="docutils literal"><span class="pre">encoding</span></code> and <code class="docutils literal"><span class="pre">errors</span></code> were passed as keyword arguments.</li>
<li>The 0-argument <code class="docutils literal"><span class="pre">super()</span></code> function now works from inside static methods such
as <code class="docutils literal"><span class="pre">__new__</span></code>. (Issue #36).</li>
<li><code class="docutils literal"><span class="pre">future.utils.native(d)</span></code> calls now work for <code class="docutils literal"><span class="pre">future.builtins.dict</span></code> objects.</li>
</ul>
</div>
<div class="section" id="changes-in-version-0-11-3-2014-02-27">
<span id="whats-new-0-11-3"></span><h2>Changes in version 0.11.3 (2014-02-27)<a class="headerlink" href="#changes-in-version-0-11-3-2014-02-27" title="Permalink to this headline">¶</a></h2>
<p>This release has improvements in the standard library import hooks mechanism and
its compatibility with 3rd-party modules:</p>
<div class="section" id="improved-compatibility-with-requests">
<h3>Improved compatibility with <code class="docutils literal"><span class="pre">requests</span></code><a class="headerlink" href="#improved-compatibility-with-requests" title="Permalink to this headline">¶</a></h3>
<p>The <code class="docutils literal"><span class="pre">__exit__</span></code> function of the <code class="docutils literal"><span class="pre">hooks</span></code> context manager and the
<code class="docutils literal"><span class="pre">remove_hooks</span></code> function both now remove submodules of
<code class="docutils literal"><span class="pre">future.standard_library</span></code> from the <code class="docutils literal"><span class="pre">sys.modules</span></code> cache. Therefore this code
is now possible on Python 2 and 3:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">future</span> <span class="kn">import</span> <span class="n">standard_library</span>
<span class="n">standard_library</span><span class="o">.</span><span class="n">install_hooks</span><span class="p">()</span>
<span class="kn">import</span> <span class="nn">http.client</span>
<span class="n">standard_library</span><span class="o">.</span><span class="n">remove_hooks</span><span class="p">()</span>
<span class="kn">import</span> <span class="nn">requests</span>
<span class="n">data</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">'http://www.google.com'</span><span class="p">)</span>
</pre></div>
</div>
<p>Previously, this required manually removing <code class="docutils literal"><span class="pre">http</span></code> and <code class="docutils literal"><span class="pre">http.client</span></code> from
<code class="docutils literal"><span class="pre">sys.modules</span></code> before importing <code class="docutils literal"><span class="pre">requests</span></code> on Python 2.x. (Issue #19).</p>
<p>This change should also improve the compatibility of the standard library hooks
with any other module that provides its own Python 2/3 compatibility code.</p>
<p>Note that the situation will improve further in version 0.12; import hooks will
require an explicit function call or the <code class="docutils literal"><span class="pre">hooks</span></code> context manager.</p>
</div>
<div class="section" id="conversion-scripts-explicitly-install-import-hooks">
<h3>Conversion scripts explicitly install import hooks<a class="headerlink" href="#conversion-scripts-explicitly-install-import-hooks" title="Permalink to this headline">¶</a></h3>
<p>The <code class="docutils literal"><span class="pre">futurize</span></code> and <code class="docutils literal"><span class="pre">pasteurize</span></code> scripts now add an explicit call to
<code class="docutils literal"><span class="pre">install_hooks()</span></code> to install the standard library import hooks. These scripts
now add these two lines:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">future</span> <span class="kn">import</span> <span class="n">standard_library</span>
<span class="n">standard_library</span><span class="o">.</span><span class="n">install_hooks</span><span class="p">()</span>
</pre></div>
</div>
<p>instead of just the first one. The next major version of <code class="docutils literal"><span class="pre">future</span></code> (0.12) will
require the explicit call or use of the <code class="docutils literal"><span class="pre">hooks</span></code> context manager. This will
allow finer-grained control over whether import hooks are enabled for other
imported modules, such as <code class="docutils literal"><span class="pre">requests</span></code>, which provide their own Python 2/3
compatibility code.</p>
</div>
<div class="section" id="futurize-script-no-longer-adds-unicode-literals-by-default">
<h3><code class="docutils literal"><span class="pre">futurize</span></code> script no longer adds <code class="docutils literal"><span class="pre">unicode_literals</span></code> by default<a class="headerlink" href="#futurize-script-no-longer-adds-unicode-literals-by-default" title="Permalink to this headline">¶</a></h3>
<p>There is a new <code class="docutils literal"><span class="pre">--unicode-literals</span></code> flag to <code class="docutils literal"><span class="pre">futurize</span></code> that adds the
import:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">__future__</span> <span class="kn">import</span> <span class="n">unicode_literals</span>
</pre></div>
</div>
<p>to the top of each converted module. Without this flag, <code class="docutils literal"><span class="pre">futurize</span></code> now no
longer adds this import. (Issue #22).</p>
<p>The <code class="docutils literal"><span class="pre">pasteurize</span></code> script for converting from Py3 to Py2/3 still adds
<code class="docutils literal"><span class="pre">unicode_literals</span></code>. (See the comments in issue #22 for an explanation.)</p>
</div>
</div>
<div class="section" id="changes-in-version-0-11-2014-01-28">
<span id="whats-new-0-11"></span><h2>Changes in version 0.11 (2014-01-28)<a class="headerlink" href="#changes-in-version-0-11-2014-01-28" title="Permalink to this headline">¶</a></h2>
<p>There are several major new features in version 0.11.</p>
<div class="section" id="past-package">
<h3><code class="docutils literal"><span class="pre">past</span></code> package<a class="headerlink" href="#past-package" title="Permalink to this headline">¶</a></h3>
<p>The python-future project now provides a <code class="docutils literal"><span class="pre">past</span></code> package in addition to the
<code class="docutils literal"><span class="pre">future</span></code> package. Whereas <code class="docutils literal"><span class="pre">future</span></code> provides improved compatibility with
Python 3 code to Python 2, <code class="docutils literal"><span class="pre">past</span></code> provides support for using and interacting
with Python 2 code from Python 3. The structure reflects that of <code class="docutils literal"><span class="pre">future</span></code>,
with <code class="docutils literal"><span class="pre">past.builtins</span></code> and <code class="docutils literal"><span class="pre">past.utils</span></code>. There is also a new
<code class="docutils literal"><span class="pre">past.translation</span></code> package that provides transparent translation of Python 2
code to Python 3. (See below.)</p>
<p>One purpose of <code class="docutils literal"><span class="pre">past</span></code> is to ease module-by-module upgrades to
codebases from Python 2. Another is to help with enabling Python 2 libraries to
support Python 3 without breaking the API they currently provide. (For example,
user code may expect these libraries to pass them Python 2’s 8-bit strings,
rather than Python 3’s <code class="docutils literal"><span class="pre">bytes</span></code> object.) A third purpose is to help migrate
projects to Python 3 even if one or more dependencies are still on Python 2.</p>
<p>Currently <code class="docutils literal"><span class="pre">past.builtins</span></code> provides forward-ports of Python 2’s <code class="docutils literal"><span class="pre">str</span></code> and
<code class="docutils literal"><span class="pre">dict</span></code> objects, <code class="docutils literal"><span class="pre">basestring</span></code>, and list-producing iterator functions. In
later releases, <code class="docutils literal"><span class="pre">past.builtins</span></code> will be used internally by the
<code class="docutils literal"><span class="pre">past.translation</span></code> package to help with importing and using old Python 2
modules in a Python 3 environment.</p>
</div>
<div class="section" id="auto-translation-of-python-2-modules-upon-import">
<h3>Auto-translation of Python 2 modules upon import<a class="headerlink" href="#auto-translation-of-python-2-modules-upon-import" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal"><span class="pre">past</span></code> provides an experimental <code class="docutils literal"><span class="pre">translation</span></code> package to help
with importing and using old Python 2 modules in a Python 3 environment.</p>
<p>This is implemented using import hooks that attempt to automatically
translate Python 2 modules to Python 3 syntax and semantics upon import. Use
it like this:</p>
<div class="highlight-python"><div class="highlight"><pre>$ pip3 install plotrique==0.2.5-7 --no-compile # to ignore SyntaxErrors
$ python3
</pre></div>
</div>
<p>Then pass in a whitelist of module name prefixes to the <code class="docutils literal"><span class="pre">past.autotranslate()</span></code>
function. Example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">past</span> <span class="kn">import</span> <span class="n">autotranslate</span>
<span class="gp">>>> </span><span class="n">autotranslate</span><span class="p">([</span><span class="s">'plotrique'</span><span class="p">])</span>
<span class="gp">>>> </span><span class="kn">import</span> <span class="nn">plotrique</span>
</pre></div>
</div>
<p>This is intended to help you migrate to Python 3 without the need for all
your code’s dependencies to support Python 3 yet. It should be used as a
last resort; ideally Python 2-only dependencies should be ported
properly to a Python 2/3 compatible codebase using a tool like
<code class="docutils literal"><span class="pre">futurize</span></code> and the changes should be pushed to the upstream project.</p>
<p>For more information, see <a class="reference internal" href="translation.html#translation"><span>Using Python 2-only dependencies on Python 3</span></a>.</p>
</div>
<div class="section" id="separate-pasteurize-script">
<h3>Separate <code class="docutils literal"><span class="pre">pasteurize</span></code> script<a class="headerlink" href="#separate-pasteurize-script" title="Permalink to this headline">¶</a></h3>
<p>The functionality from <code class="docutils literal"><span class="pre">futurize</span> <span class="pre">--from3</span></code> is now in a separate script called
<code class="docutils literal"><span class="pre">pasteurize</span></code>. Use <code class="docutils literal"><span class="pre">pasteurize</span></code> when converting from Python 3 code to Python
2/3 compatible source. For more information, see <a class="reference internal" href="pasteurize.html#backwards-conversion"><span>pasteurize: Py3 to Py2/3</span></a>.</p>
</div>
<div class="section" id="pow">
<h3>pow()<a class="headerlink" href="#pow" title="Permalink to this headline">¶</a></h3>
<p>There is now a <code class="docutils literal"><span class="pre">pow()</span></code> function in <code class="docutils literal"><span class="pre">future.builtins.misc</span></code> that behaves like
the Python 3 <code class="docutils literal"><span class="pre">pow()</span></code> function when raising a negative number to a fractional
power (returning a complex number).</p>
</div>
<div class="section" id="input-no-longer-disabled-globally-on-py2">
<h3>input() no longer disabled globally on Py2<a class="headerlink" href="#input-no-longer-disabled-globally-on-py2" title="Permalink to this headline">¶</a></h3>
<p>Previous versions of <code class="docutils literal"><span class="pre">future</span></code> deleted the <code class="docutils literal"><span class="pre">input()</span></code> function from
<code class="docutils literal"><span class="pre">__builtin__</span></code> on Python 2 as a security measure. This was because
Python 2’s <code class="docutils literal"><span class="pre">input()</span></code> function allows arbitrary code execution and could
present a security vulnerability on Python 2 if someone expects Python 3
semantics but forgets to import <code class="docutils literal"><span class="pre">input</span></code> from <code class="docutils literal"><span class="pre">future.builtins</span></code>. This
behaviour has been reverted, in the interests of broadening the
compatibility of <code class="docutils literal"><span class="pre">future</span></code> with other Python 2 modules.</p>
<p>Please remember to import <code class="docutils literal"><span class="pre">input</span></code> from <code class="docutils literal"><span class="pre">future.builtins</span></code> if you use
<code class="docutils literal"><span class="pre">input()</span></code> in a Python 2/3 compatible codebase.</p>
</div>
<div class="section" id="deprecated-feature-auto-installation-of-standard-library-import-hooks">
<span id="deprecated-auto-import-hooks"></span><h3>Deprecated feature: auto-installation of standard-library import hooks<a class="headerlink" href="#deprecated-feature-auto-installation-of-standard-library-import-hooks" title="Permalink to this headline">¶</a></h3>
<p>Previous versions of <code class="docutils literal"><span class="pre">python-future</span></code> installed import hooks automatically upon
importing the <code class="docutils literal"><span class="pre">standard_library</span></code> module from <code class="docutils literal"><span class="pre">future</span></code>. This has been
deprecated in order to improve robustness and compatibility with modules like
<code class="docutils literal"><span class="pre">requests</span></code> that already perform their own single-source Python 2/3
compatibility.</p>
<p>As of v0.12 of <code class="docutils literal"><span class="pre">python-future</span></code>, importing <code class="docutils literal"><span class="pre">future.standard_library</span></code>
will no longer install import hooks by default. Instead, please install the
import hooks explicitly as follows:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">future</span> <span class="kn">import</span> <span class="n">standard_library</span>
<span class="n">standard_library</span><span class="o">.</span><span class="n">install_hooks</span><span class="p">()</span>
</pre></div>
</div>
<p>and uninstall them after your import statements using:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">standard_library</span><span class="o">.</span><span class="n">remove_hooks</span><span class="p">()</span>
</pre></div>
</div>
<p><em>Note</em>: this will be a backward-incompatible change.</p>
</div>
<div class="section" id="internal-changes">
<h3>Internal changes<a class="headerlink" href="#internal-changes" title="Permalink to this headline">¶</a></h3>
<p>The internal <code class="docutils literal"><span class="pre">future.builtins.backports</span></code> module has been renamed to
<code class="docutils literal"><span class="pre">future.builtins.types</span></code>. This will change the <code class="docutils literal"><span class="pre">repr</span></code> of <code class="docutils literal"><span class="pre">future</span></code>
types but not their use.</p>
</div>
</div>
<div class="section" id="changes-in-version-0-10-2-2014-01-11">
<span id="whats-new-0-10-2"></span><h2>Changes in version 0.10.2 (2014-01-11)<a class="headerlink" href="#changes-in-version-0-10-2-2014-01-11" title="Permalink to this headline">¶</a></h2>
<div class="section" id="new-context-manager-interface-to-standard-library-hooks">
<h3>New context-manager interface to standard_library hooks<a class="headerlink" href="#new-context-manager-interface-to-standard-library-hooks" title="Permalink to this headline">¶</a></h3>
<p>There is a new context manager <code class="docutils literal"><span class="pre">future.standard_library.hooks</span></code>. Use it like
this:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">future</span> <span class="kn">import</span> <span class="n">standard_library</span>
<span class="k">with</span> <span class="n">standard_library</span><span class="o">.</span><span class="n">hooks</span><span class="p">():</span>
<span class="kn">import</span> <span class="nn">queue</span>
<span class="kn">import</span> <span class="nn">configserver</span>
<span class="kn">from</span> <span class="nn">http.client</span> <span class="kn">import</span> <span class="n">HTTPConnection</span>
<span class="c"># etc.</span>
</pre></div>
</div>
<p>If not using this context manager, it is now encouraged to add an explicit call to
<code class="docutils literal"><span class="pre">standard_library.install_hooks()</span></code> as follows:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">future</span> <span class="kn">import</span> <span class="n">standard_library</span>
<span class="n">standard_library</span><span class="o">.</span><span class="n">install_hooks</span><span class="p">()</span>
<span class="kn">import</span> <span class="nn">queue</span>
<span class="kn">import</span> <span class="nn">html</span>
<span class="kn">import</span> <span class="nn">http.client</span>
<span class="c"># etc.</span>
</pre></div>
</div>
<p>and to remove the hooks afterwards with:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">standard_library</span><span class="o">.</span><span class="n">remove_hooks</span><span class="p">()</span>
</pre></div>
</div>
<p>The functions <code class="docutils literal"><span class="pre">install_hooks()</span></code> and <code class="docutils literal"><span class="pre">remove_hooks()</span></code> were previously
called <code class="docutils literal"><span class="pre">enable_hooks()</span></code> and <code class="docutils literal"><span class="pre">disable_hooks()</span></code>. The old names are
still available as aliases, but are deprecated.</p>
<p>As usual, this feature has no effect on Python 3.</p>
</div>
</div>
<div class="section" id="changes-in-version-0-10-0-2013-12-02">
<span id="whats-new-0-10"></span><h2>Changes in version 0.10.0 (2013-12-02)<a class="headerlink" href="#changes-in-version-0-10-0-2013-12-02" title="Permalink to this headline">¶</a></h2>
<div class="section" id="backported-dict-type">
<h3>Backported <code class="docutils literal"><span class="pre">dict</span></code> type<a class="headerlink" href="#backported-dict-type" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal"><span class="pre">future.builtins</span></code> now provides a Python 2 <code class="docutils literal"><span class="pre">dict</span></code> subclass whose
<code class="xref py py-func docutils literal"><span class="pre">keys()</span></code>, <code class="xref py py-func docutils literal"><span class="pre">values()</span></code>, and <code class="xref py py-func docutils literal"><span class="pre">items()</span></code> methods produce
memory-efficient iterators. On Python 2.7, these also have the same set-like
view behaviour as on Python 3. This can streamline code needing to iterate
over large dictionaries. For example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">__future__</span> <span class="kn">import</span> <span class="n">print_function</span>
<span class="kn">from</span> <span class="nn">future.builtins</span> <span class="kn">import</span> <span class="nb">dict</span><span class="p">,</span> <span class="nb">range</span>
<span class="n">squares</span> <span class="o">=</span> <span class="nb">dict</span><span class="p">({</span><span class="n">i</span><span class="p">:</span> <span class="n">i</span><span class="o">**</span><span class="mi">2</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">10</span><span class="o">**</span><span class="mi">7</span><span class="p">)})</span>
<span class="k">assert</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">d</span><span class="o">.</span><span class="n">items</span><span class="p">(),</span> <span class="nb">list</span><span class="p">)</span>
<span class="c"># Because items() is memory-efficient, so is this:</span>
<span class="n">square_roots</span> <span class="o">=</span> <span class="nb">dict</span><span class="p">((</span><span class="n">i_squared</span><span class="p">,</span> <span class="n">i</span><span class="p">)</span> <span class="k">for</span> <span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">i_squared</span><span class="p">)</span> <span class="ow">in</span> <span class="n">squares</span><span class="o">.</span><span class="n">items</span><span class="p">())</span>
</pre></div>
</div>
<p>For more information, see <a class="reference internal" href="what_else.html#dict-object"><span>dict</span></a>.</p>
</div>
<div class="section" id="utility-functions-raise-and-exec">
<h3>Utility functions <code class="docutils literal"><span class="pre">raise_</span></code> and <code class="docutils literal"><span class="pre">exec_</span></code><a class="headerlink" href="#utility-functions-raise-and-exec" title="Permalink to this headline">¶</a></h3>
<p>The functions <code class="docutils literal"><span class="pre">raise_with_traceback()</span></code> and <code class="docutils literal"><span class="pre">raise_()</span></code> were
added to <code class="docutils literal"><span class="pre">future.utils</span></code> to offer either the Python 3.x or Python 2.x
behaviour for raising exceptions. Thanks to Joel Tratner for the
contribution of these. <code class="docutils literal"><span class="pre">future.utils.reraise()</span></code> is now deprecated.</p>
<p>A portable <code class="docutils literal"><span class="pre">exec_()</span></code> function has been added to <code class="docutils literal"><span class="pre">future.utils</span></code> from
<code class="docutils literal"><span class="pre">six</span></code>.</p>
</div>
<div class="section" id="bugfixes">
<h3>Bugfixes<a class="headerlink" href="#bugfixes" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li>Fixed newint.__divmod__</li>
<li>Improved robustness of installing and removing import hooks in <a class="reference internal" href="reference.html#module-future.standard_library" title="future.standard_library"><code class="xref py py-mod docutils literal"><span class="pre">future.standard_library</span></code></a></li>
<li>v0.10.1: Fixed broken <code class="docutils literal"><span class="pre">pip</span> <span class="pre">install</span> <span class="pre">future</span></code> on Py3</li>
</ul>
</div>
</div>
<div class="section" id="changes-in-version-0-9-2013-11-06">
<span id="whats-new-0-9"></span><h2>Changes in version 0.9 (2013-11-06)<a class="headerlink" href="#changes-in-version-0-9-2013-11-06" title="Permalink to this headline">¶</a></h2>
<div class="section" id="isinstance-checks-are-supported-natively-with-backported-types">
<h3><code class="docutils literal"><span class="pre">isinstance</span></code> checks are supported natively with backported types<a class="headerlink" href="#isinstance-checks-are-supported-natively-with-backported-types" title="Permalink to this headline">¶</a></h3>
<p>The <code class="docutils literal"><span class="pre">isinstance</span></code> function is no longer redefined in <code class="docutils literal"><span class="pre">future.builtins</span></code>
to operate with the backported <code class="docutils literal"><span class="pre">int</span></code>, <code class="docutils literal"><span class="pre">bytes</span></code> and <code class="docutils literal"><span class="pre">str</span></code>.
<code class="docutils literal"><span class="pre">isinstance</span></code> checks with the backported types now work correctly by
default; we achieve this through overriding the <code class="docutils literal"><span class="pre">__instancecheck__</span></code>
method of metaclasses of the backported types.</p>
<p>For more information, see <a class="reference internal" href="what_else.html#isinstance-calls"><span>isinstance</span></a>.</p>
</div>
<div class="section" id="futurize-minimal-imports-by-default">
<h3><code class="docutils literal"><span class="pre">futurize</span></code>: minimal imports by default<a class="headerlink" href="#futurize-minimal-imports-by-default" title="Permalink to this headline">¶</a></h3>
<p>By default, the <code class="docutils literal"><span class="pre">futurize</span></code> script now only adds the minimal set of
imports deemed necessary.</p>
<p>There is now an <code class="docutils literal"><span class="pre">--all-imports</span></code> option to the <code class="docutils literal"><span class="pre">futurize</span></code> script which
gives the previous behaviour, which is to add all <code class="docutils literal"><span class="pre">__future__</span></code> imports
and <code class="docutils literal"><span class="pre">from</span> <span class="pre">future.builtins</span> <span class="pre">import</span> <span class="pre">*</span></code> imports to every module. (This even
applies to an empty <code class="docutils literal"><span class="pre">__init__.py</span></code> file.)</p>
</div>
<div class="section" id="looser-type-checking-for-the-backported-str-object">
<h3>Looser type-checking for the backported <code class="docutils literal"><span class="pre">str</span></code> object<a class="headerlink" href="#looser-type-checking-for-the-backported-str-object" title="Permalink to this headline">¶</a></h3>
<p>Now the <code class="docutils literal"><span class="pre">future.builtins.str</span></code> object behaves more like the Python 2
<code class="docutils literal"><span class="pre">unicode</span></code> object with regard to type-checking. This is to work around some
bugs / sloppiness in the Python 2 standard library involving mixing of
byte-strings and unicode strings, such as <code class="docutils literal"><span class="pre">os.path.join</span></code> in <code class="docutils literal"><span class="pre">posixpath.py</span></code>.</p>
<p><code class="docutils literal"><span class="pre">future.builtins.str</span></code> still raises the expected <code class="docutils literal"><span class="pre">TypeError</span></code> exceptions from
Python 3 when attempting to mix it with <code class="docutils literal"><span class="pre">future.builtins.bytes</span></code>.</p>
</div>
<div class="section" id="suspend-hooks-context-manager-added-to-future-standard-library">
<h3>suspend_hooks() context manager added to <code class="docutils literal"><span class="pre">future.standard_library</span></code><a class="headerlink" href="#suspend-hooks-context-manager-added-to-future-standard-library" title="Permalink to this headline">¶</a></h3>
<p>Pychecker (as of v0.6.1)’s <code class="docutils literal"><span class="pre">checker.py</span></code> attempts to import the <code class="docutils literal"><span class="pre">builtins</span></code>
module as a way of determining whether Python 3 is running. Since this
succeeds when <code class="docutils literal"><span class="pre">from</span> <span class="pre">future</span> <span class="pre">import</span> <span class="pre">standard_library</span></code> is in effect, this
check does not work and pychecker sets the wrong value for its internal <code class="docutils literal"><span class="pre">PY2</span></code>
flag is set.</p>
<p>To work around this, <code class="docutils literal"><span class="pre">future</span></code> now provides a context manager called
<code class="docutils literal"><span class="pre">suspend_hooks</span></code> that can be used as follows:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">future</span> <span class="kn">import</span> <span class="n">standard_library</span>
<span class="o">...</span>
<span class="k">with</span> <span class="n">standard_library</span><span class="o">.</span><span class="n">suspend_hooks</span><span class="p">():</span>
<span class="kn">from</span> <span class="nn">pychecker.checker</span> <span class="kn">import</span> <span class="n">Checker</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="changes-in-version-0-8-2013-10-28">
<span id="whats-new-0-8"></span><h2>Changes in version 0.8 (2013-10-28)<a class="headerlink" href="#changes-in-version-0-8-2013-10-28" title="Permalink to this headline">¶</a></h2>
<div class="section" id="python-2-6-support">
<h3>Python 2.6 support<a class="headerlink" href="#python-2-6-support" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal"><span class="pre">future</span></code> now includes support for Python 2.6.</p>
<p>To run the <code class="docutils literal"><span class="pre">future</span></code> test suite on Python 2.6, this additional package is needed:</p>
<div class="highlight-python"><div class="highlight"><pre>pip install unittest2
</pre></div>
</div>
<p><code class="docutils literal"><span class="pre">http.server</span></code> also requires the <code class="docutils literal"><span class="pre">argparse</span></code> package:</p>
<div class="highlight-python"><div class="highlight"><pre>pip install argparse
</pre></div>
</div>
</div>
<div class="section" id="unused-modules-removed">
<h3>Unused modules removed<a class="headerlink" href="#unused-modules-removed" title="Permalink to this headline">¶</a></h3>
<p>The <code class="docutils literal"><span class="pre">future.six</span></code> module has been removed. <code class="docutils literal"><span class="pre">future</span></code> doesn’t require <code class="docutils literal"><span class="pre">six</span></code>
(and hasn’t since version 0.3). If you need support for Python versions before
2.6, <code class="docutils literal"><span class="pre">six</span></code> is the best option. <code class="docutils literal"><span class="pre">future</span></code> and <code class="docutils literal"><span class="pre">six</span></code> can be installed
alongside each other easily if needed.</p>
<p>The unused <code class="docutils literal"><span class="pre">hacks</span></code> module has also been removed from the source tree.</p>
</div>
<div class="section" id="isinstance-added-to-future-builtins-v0-8-2">
<h3>isinstance() added to <a class="reference internal" href="reference.html#module-future.builtins" title="future.builtins"><code class="xref py py-mod docutils literal"><span class="pre">future.builtins</span></code></a> (v0.8.2)<a class="headerlink" href="#isinstance-added-to-future-builtins-v0-8-2" title="Permalink to this headline">¶</a></h3>
<p>It is now possible to use <code class="docutils literal"><span class="pre">isinstance()</span></code> calls normally after importing <code class="docutils literal"><span class="pre">isinstance</span></code> from
<code class="docutils literal"><span class="pre">future.builtins</span></code>. On Python 2, this is specially defined to be compatible with
<code class="docutils literal"><span class="pre">future</span></code>‘s backported <code class="docutils literal"><span class="pre">int</span></code>, <code class="docutils literal"><span class="pre">str</span></code>, and <code class="docutils literal"><span class="pre">bytes</span></code> types, as well as
handling Python 2’s int/long distinction.</p>
<p>The result is that code that uses <code class="docutils literal"><span class="pre">isinstance</span></code> to perform type-checking of
ints, strings, and bytes should now work identically on Python 2 as on Python 3.</p>
<p>The utility functions <code class="docutils literal"><span class="pre">isint</span></code>, <code class="docutils literal"><span class="pre">istext</span></code>, and <code class="docutils literal"><span class="pre">isbytes</span></code> provided before for
compatible type-checking across Python 2 and 3 in <a class="reference internal" href="reference.html#module-future.utils" title="future.utils"><code class="xref py py-mod docutils literal"><span class="pre">future.utils</span></code></a> are now
deprecated.</p>
</div>
</div>
<div class="section" id="summary-of-all-changes">
<span id="changelog"></span><h2>Summary of all changes<a class="headerlink" href="#summary-of-all-changes" title="Permalink to this headline">¶</a></h2>
<dl class="docutils">
<dt>v0.14.3:</dt>
<dd><ul class="first last simple">
<li>Bug fixes</li>
</ul>
</dd>
<dt>v0.14.2:</dt>
<dd><ul class="first last simple">
<li>Bug fixes</li>
</ul>
</dd>
<dt>v0.14.1:</dt>
<dd><ul class="first last simple">
<li>Bug fixes</li>
</ul>
</dd>
<dt>v0.14:</dt>
<dd><ul class="first last simple">
<li>New top-level <code class="docutils literal"><span class="pre">builtins</span></code> package on Py2 for cleaner imports. Equivalent to
<code class="docutils literal"><span class="pre">future.builtins</span></code></li>
<li>New top-level packages on Py2 with the same names as Py3 standard modules:
<code class="docutils literal"><span class="pre">configparser</span></code>, <code class="docutils literal"><span class="pre">copyreg</span></code>, <code class="docutils literal"><span class="pre">html</span></code>, <code class="docutils literal"><span class="pre">http</span></code>, <code class="docutils literal"><span class="pre">xmlrpc</span></code>, <code class="docutils literal"><span class="pre">winreg</span></code></li>
</ul>
</dd>
<dt>v0.13.1:</dt>
<dd><ul class="first last simple">
<li>Bug fixes</li>
</ul>
</dd>
<dt>v0.13.0:</dt>
<dd><ul class="first last simple">
<li>Cheat sheet for writing Python 2/3 compatible code</li>
<li><code class="docutils literal"><span class="pre">to_int</span></code> and <code class="docutils literal"><span class="pre">from_int</span></code> methods for <code class="docutils literal"><span class="pre">newbytes</span></code></li>
<li>Bug fixes</li>
</ul>
</dd>
<dt>v0.12.0:</dt>
<dd><ul class="first last simple">
<li>Add <code class="docutils literal"><span class="pre">newobject</span></code> and <code class="docutils literal"><span class="pre">newlist</span></code> types</li>
<li>Improve compatibility of import hooks with Requests, py2exe</li>
<li>No more auto-installation of import hooks by <code class="docutils literal"><span class="pre">future.standard_library</span></code></li>
<li>New <code class="docutils literal"><span class="pre">future.moves</span></code> package</li>
<li><code class="docutils literal"><span class="pre">past.builtins</span></code> improved</li>
<li><code class="docutils literal"><span class="pre">newstr.encode(...,</span> <span class="pre">errors='surrogateescape')</span></code> supported</li>
<li>Refactoring: <code class="docutils literal"><span class="pre">future.standard_library</span></code> submodules -> <code class="docutils literal"><span class="pre">future.backports</span></code></li>
<li>Refactoring: <code class="docutils literal"><span class="pre">future.builtins.types</span></code> -> <code class="docutils literal"><span class="pre">future.types</span></code></li>
<li>Refactoring: <code class="docutils literal"><span class="pre">past.builtins.types</span></code> -> <code class="docutils literal"><span class="pre">past.types</span></code></li>
<li>New <code class="docutils literal"><span class="pre">listvalues</span></code> and <code class="docutils literal"><span class="pre">listitems</span></code> functions in <code class="docutils literal"><span class="pre">future.utils</span></code></li>
<li>Many bug fixes to <code class="docutils literal"><span class="pre">futurize</span></code>, <code class="docutils literal"><span class="pre">future.builtins</span></code>, etc.</li>
</ul>
</dd>
<dt>v0.11.4:</dt>
<dd><ul class="first last simple">
<li>Restore Py2.6 compatibility</li>
</ul>
</dd>
<dt>v0.11.3:</dt>
<dd><ul class="first last simple">
<li>The <code class="docutils literal"><span class="pre">futurize</span></code> and <code class="docutils literal"><span class="pre">pasteurize</span></code> scripts add an explicit call to
<code class="docutils literal"><span class="pre">future.standard_library.install_hooks()</span></code> whenever modules affected by
PEP 3108 are imported.</li>
<li>The <code class="docutils literal"><span class="pre">future.builtins.bytes</span></code> constructor now accepts <code class="docutils literal"><span class="pre">frozenset</span></code>
objects as on Py3.</li>
</ul>
</dd>
<dt>v0.11.2:</dt>
<dd><ul class="first last simple">
<li>The <code class="docutils literal"><span class="pre">past.autotranslate</span></code> feature now finds modules to import more
robustly and works with Python eggs.</li>
</ul>
</dd>
<dt>v0.11.1:</dt>
<dd><ul class="first last simple">
<li>Update to <code class="docutils literal"><span class="pre">requirements_py26.txt</span></code> for Python 2.6. Small updates to
docs and tests.</li>
</ul>
</dd>
<dt>v0.11:</dt>
<dd><ul class="first last simple">
<li>New <code class="docutils literal"><span class="pre">past</span></code> package with <code class="docutils literal"><span class="pre">past.builtins</span></code> and <code class="docutils literal"><span class="pre">past.translation</span></code>
modules.</li>
</ul>
</dd>
<dt>v0.10.2:</dt>
<dd><ul class="first last simple">
<li>Improvements to stdlib hooks. New context manager:
<code class="docutils literal"><span class="pre">future.standard_library.hooks()</span></code>.</li>
<li>New <code class="docutils literal"><span class="pre">raise_</span></code> and <code class="docutils literal"><span class="pre">raise_with_traceback</span></code> functions in <code class="docutils literal"><span class="pre">future.utils</span></code>.</li>
</ul>
</dd>
<dt>v0.10:</dt>
<dd><ul class="first last simple">
<li>New backported <code class="docutils literal"><span class="pre">dict</span></code> object with set-like <code class="docutils literal"><span class="pre">keys</span></code>, <code class="docutils literal"><span class="pre">values</span></code>, <code class="docutils literal"><span class="pre">items</span></code></li>
</ul>
</dd>
<dt>v0.9:</dt>
<dd><ul class="first last simple">
<li><a class="reference external" href="http://docs.python.org/library/functions.html#isinstance" title="(in Python v2.7)"><code class="xref py py-func docutils literal"><span class="pre">isinstance()</span></code></a> hack removed in favour of <code class="docutils literal"><span class="pre">__instancecheck__</span></code> on the
metaclasses of the backported types</li>
<li><code class="docutils literal"><span class="pre">futurize</span></code> now only adds necessary imports by default</li>
<li>Looser type-checking by <code class="docutils literal"><span class="pre">future.builtins.str</span></code> when combining with Py2
native byte-strings.</li>
</ul>
</dd>
<dt>v0.8.3:</dt>
<dd><ul class="first last simple">
<li>New <code class="docutils literal"><span class="pre">--all-imports</span></code> option to <code class="docutils literal"><span class="pre">futurize</span></code></li>
<li>Fix bug with <code class="docutils literal"><span class="pre">str.encode()</span></code> with encoding as a non-keyword arg</li>
</ul>
</dd>
<dt>v0.8.2:</dt>
<dd><ul class="first last simple">
<li>New <code class="docutils literal"><span class="pre">isinstance</span></code> function in <a class="reference internal" href="reference.html#module-future.builtins" title="future.builtins"><code class="xref py py-mod docutils literal"><span class="pre">future.builtins</span></code></a>. This obviates
and deprecates the utility functions for type-checking in <a class="reference internal" href="reference.html#module-future.utils" title="future.utils"><code class="xref py py-mod docutils literal"><span class="pre">future.utils</span></code></a>.</li>
</ul>
</dd>
<dt>v0.8.1:</dt>
<dd><ul class="first last simple">
<li>Backported <code class="docutils literal"><span class="pre">socketserver.py</span></code>. Fixes sporadic test failures with
<code class="docutils literal"><span class="pre">http.server</span></code> (related to threading and old-style classes used in Py2.7’s
<code class="docutils literal"><span class="pre">SocketServer.py</span></code>).</li>
<li>Move a few more safe <code class="docutils literal"><span class="pre">futurize</span></code> fixes from stage2 to stage1</li>
<li>Bug fixes to <a class="reference internal" href="reference.html#module-future.utils" title="future.utils"><code class="xref py py-mod docutils literal"><span class="pre">future.utils</span></code></a></li>
</ul>
</dd>
<dt>v0.8:</dt>
<dd><ul class="first last simple">
<li>Added Python 2.6 support</li>
<li>Removed unused modules: <code class="xref py py-mod docutils literal"><span class="pre">future.six</span></code> and <code class="xref py py-mod docutils literal"><span class="pre">future.hacks</span></code></li>
<li>Removed undocumented functions from <a class="reference internal" href="reference.html#module-future.utils" title="future.utils"><code class="xref py py-mod docutils literal"><span class="pre">future.utils</span></code></a></li>
</ul>
</dd>
<dt>v0.7:</dt>
<dd><ul class="first last simple">
<li>Added a backported Py3-like <code class="docutils literal"><span class="pre">int</span></code> object (inherits from long).</li>
<li>Added utility functions for type-checking and docs about
<code class="docutils literal"><span class="pre">isinstance</span></code> uses/alternatives.</li>
<li>Fixes and stricter type-checking for bytes and str objects</li>
<li>Added many more tests for the <code class="docutils literal"><span class="pre">futurize</span></code> script</li>
<li>We no longer disable obsolete Py2 builtins by default with <code class="docutils literal"><span class="pre">from</span>
<span class="pre">future.builtins</span> <span class="pre">import</span> <span class="pre">*</span></code>. Use <code class="docutils literal"><span class="pre">from</span> <span class="pre">future.builtins.disabled</span>
<span class="pre">import</span> <span class="pre">*</span></code> instead.</li>
</ul>
</dd>
<dt>v0.6:</dt>
<dd><ul class="first last simple">
<li>Added a backported Py3-like <code class="docutils literal"><span class="pre">str</span></code> object (inherits from Py2’s <code class="docutils literal"><span class="pre">unicode</span></code>)</li>
<li>Removed support for the form <code class="docutils literal"><span class="pre">from</span> <span class="pre">future</span> <span class="pre">import</span> <span class="pre">*</span></code>: use <code class="docutils literal"><span class="pre">from</span> <span class="pre">future.builtins</span> <span class="pre">import</span> <span class="pre">*</span></code> instead</li>
</ul>
</dd>
<dt>v0.5.3:</dt>
<dd><ul class="first last simple">
<li>Doc improvements</li>
</ul>
</dd>
<dt>v0.5.2:</dt>
<dd><ul class="first last simple">
<li>Add lots of docs and a Sphinx project</li>
</ul>
</dd>
<dt>v0.5.1:</dt>
<dd><ul class="first last simple">
<li>Upgraded included <code class="docutils literal"><span class="pre">six</span></code> module (included as <code class="docutils literal"><span class="pre">future.utils.six</span></code>) to v1.4.1</li>
<li><code class="xref py py-mod docutils literal"><span class="pre">http.server</span></code> module backported</li>
<li>bytes.split() and .rsplit() bugfixes</li>
</ul>
</dd>
<dt>v0.5.0:</dt>
<dd><ul class="first last simple">
<li>Added backported Py3-like <code class="docutils literal"><span class="pre">bytes</span></code> object</li>
</ul>
</dd>
<dt>v0.4.2:</dt>
<dd><ul class="first last simple">
<li>Various fixes</li>
</ul>
</dd>
<dt>v0.4.1:</dt>
<dd><ul class="first last simple">
<li>Added <a class="reference external" href="http://docs.python.org/library/functions.html#open" title="(in Python v2.7)"><code class="xref py py-func docutils literal"><span class="pre">open()</span></code></a> (from <a class="reference external" href="http://docs.python.org/library/io.html#module-io" title="(in Python v2.7)"><code class="xref py py-mod docutils literal"><span class="pre">io</span></code></a> module on Py2)</li>
<li>Improved docs</li>
</ul>
</dd>
<dt>v0.4.0:</dt>
<dd><ul class="first last simple">
<li>Added various useful compatibility functions to <a class="reference internal" href="reference.html#module-future.utils" title="future.utils"><code class="xref py py-mod docutils literal"><span class="pre">future.utils</span></code></a></li>
<li>Reorganized package: moved all builtins to <a class="reference internal" href="reference.html#module-future.builtins" title="future.builtins"><code class="xref py py-mod docutils literal"><span class="pre">future.builtins</span></code></a>; moved
all stdlib things to <code class="docutils literal"><span class="pre">future.standard_library</span></code></li>
<li>Renamed <code class="docutils literal"><span class="pre">python-futurize</span></code> console script to <code class="docutils literal"><span class="pre">futurize</span></code></li>
<li>Moved <code class="docutils literal"><span class="pre">future.six</span></code> to <code class="docutils literal"><span class="pre">future.utils.six</span></code> and pulled the most relevant
definitions to <a class="reference internal" href="reference.html#module-future.utils" title="future.utils"><code class="xref py py-mod docutils literal"><span class="pre">future.utils</span></code></a>.</li>
<li>More improvements to “Py3 to both” conversion (<code class="docutils literal"><span class="pre">futurize.py</span> <span class="pre">--from3</span></code>)</li>
</ul>
</dd>
<dt>v0.3.5:</dt>
<dd><ul class="first last simple">
<li>Fixed broken package setup (“package directory ‘libfuturize/tests’ does not exist”)</li>
</ul>
</dd>
<dt>v0.3.4:</dt>
<dd><ul class="first last simple">
<li>Added <code class="docutils literal"><span class="pre">itertools.zip_longest</span></code></li>
<li>Updated 2to3_backcompat tests to use futurize.py</li>
<li>Improved libfuturize fixers: correct order of imports; add imports only when necessary (except absolute_import currently)</li>
</ul>
</dd>
<dt>v0.3.3:</dt>
<dd><ul class="first last simple">
<li>Added <code class="docutils literal"><span class="pre">python-futurize</span></code> console script</li>
<li>Added <code class="docutils literal"><span class="pre">itertools.filterfalse</span></code></li>
<li>Removed docs about unfinished backports (urllib etc.)</li>
<li>Removed old Py2 syntax in some files that breaks py3 setup.py install</li>
</ul>
</dd>
<dt>v0.3.2:</dt>
<dd><ul class="first last simple">
<li>Added test.support module</li>
<li>Added UserList, UserString, UserDict classes to collections module</li>
<li>Removed <code class="docutils literal"><span class="pre">int</span></code> -> <code class="docutils literal"><span class="pre">long</span></code> mapping</li>
<li>Added backported <code class="docutils literal"><span class="pre">_markupbase.py</span></code> etc. with new-style classes to fix travis-ci build problems</li>
<li>Added working <code class="docutils literal"><span class="pre">html</span></code> and <code class="docutils literal"><span class="pre">http.client</span></code> backported modules</li>
</ul>
</dd>
<dt>v0.3.0:</dt>
<dd><ul class="first last simple">
<li>Generalized import hooks to allow dotted imports</li>
<li>Added backports of <code class="docutils literal"><span class="pre">urllib</span></code>, <code class="docutils literal"><span class="pre">html</span></code>, <code class="docutils literal"><span class="pre">http</span></code> modules from Py3.3 stdlib using <code class="docutils literal"><span class="pre">future</span></code></li>
<li>Added <code class="docutils literal"><span class="pre">futurize</span></code> script for automatically turning Py2 or Py3 modules into
cross-platform Py3 modules</li>
<li>Renamed <code class="docutils literal"><span class="pre">future.standard_library_renames</span></code> to
<code class="docutils literal"><span class="pre">future.standard_library</span></code>. (No longer just renames, but backports too.)</li>
</ul>
</dd>
<dt>v0.2.2.1:</dt>
<dd><ul class="first last simple">
<li>Small bug fixes to get tests passing on travis-ci.org</li>
</ul>
</dd>
<dt>v0.2.1:</dt>
<dd><ul class="first last simple">
<li>Small bug fixes</li>
</ul>
</dd>
<dt>v0.2.0:</dt>
<dd><ul class="first last">
<li><p class="first">Features module renamed to modified_builtins</p>
</li>
<li><p class="first">New functions added: <a class="reference external" href="http://docs.python.org/library/functions.html#round" title="(in Python v2.7)"><code class="xref py py-func docutils literal"><span class="pre">round()</span></code></a>, <a class="reference external" href="http://docs.python.org/library/functions.html#input" title="(in Python v2.7)"><code class="xref py py-func docutils literal"><span class="pre">input()</span></code></a></p>
</li>
<li><p class="first">No more namespace pollution as a policy:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">future</span> <span class="kn">import</span> <span class="o">*</span>
</pre></div>
</div>
<p>should have no effect on Python 3. On Python 2, it only shadows the
builtins; it doesn’t introduce any new names.</p>
</li>
<li><p class="first">End-to-end tests with Python 2 code and 2to3 now work</p>
</li>
</ul>
</dd>
<dt>v0.1.0:</dt>
<dd><ul class="first last simple">
<li>first version with tests!</li>
<li>removed the inspect-module magic</li>
</ul>
</dd>
<dt>v0.0.x:</dt>
<dd><ul class="first last simple">
<li>initial releases. Use at your peril.</li>
</ul>
</dd>
</dl>
</div>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="pull-right">
<a href="#">Back to top</a>
</p>
<p>
© Copyright 2013-2015, Python Charmers Pty Ltd, Australia.<br/>
</p>
</div>
</footer>
<div class="footer">
<script type="text/javascript">
(function() {
var ga = document.createElement('script');
ga.src = ('https:' == document.location.protocol ?
'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
ga.setAttribute('async', 'true');
document.documentElement.firstChild.appendChild(ga);
})();
</script>
</div>
</body>
</html>
|