From b6338979b7254e4884f4affb15ea86e741671cfa Mon Sep 17 00:00:00 2001 From: Mark Pilgrim Date: Tue, 27 Jan 2009 21:17:44 -0500 Subject: [PATCH] moved "modules that have been renamed or reorganized" closer to the top --- porting-code-to-python-3-with-2to3.html | 464 ++++++++++++------------ 1 file changed, 232 insertions(+), 232 deletions(-) diff --git a/porting-code-to-python-3-with-2to3.html b/porting-code-to-python-3-with-2to3.html index b583773..7a07914 100644 --- a/porting-code-to-python-3-with-2to3.html +++ b/porting-code-to-python-3-with-2to3.html @@ -53,6 +53,7 @@ for (var i = arTables.length - 1; i >= 0; i--) {
  • <> comparison
  • has_key() dictionary method
  • Dictionary methods
  • +
  • Modules that have been renamed or reorganized
  • filter() global function
  • map() global function
  • apply() global function
  • @@ -67,7 +68,6 @@ for (var i = arTables.length - 1; i >= 0; i--) {
  • raw_input() and input() global functions
  • func_* function attributes
  • xreadlines() I/O method
  • -
  • imports
  • lambda functions with multiple parameters
  • __class__ special class attribute
  • next() iterator method
  • @@ -285,6 +285,237 @@ for (var i = arTables.length - 1; i >= 0; i--) { +
    +

    Modules that have been renamed or reorganized

    + +

    FIXME intro

    +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NotesPython 2Python 3
    import StringIO
    +import cStringIO
    import io
    import cPickleimport pickle
    import __builtin__import builtins
    import copy_regimport copyreg
    import Queueimport queue
    import SocketServerimport socketserver
    import ConfigParserimport configparser
    import reprimport reprlib
    import commandsimport subprocess
    + +
      +
    1. ...
    2. +
    3. ...
    4. +
    5. ...
    6. +
    7. ...
    8. +
    9. ...
    10. +
    11. ...
    12. +
    13. ...
    14. +
    15. ...
    16. +
    17. ...
    18. +
    + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NotesPython 2Python 3
    import dbmimport dbm.ndbm
    import gdbmimport dbm.gnu
    import dbhashimport dbm.bsd
    import dumbdbmimport dbm.dumb
    import anydbm
    +import whichdb
    import dbm
    + +
      +
    1. ...
    2. +
    3. ...
    4. +
    5. ...
    6. +
    7. ...
    8. +
    9. ...
    10. +
    + +

    + + + + + + + + + + + + + + + + +
    NotesPython 2Python 3
    import xmlrpclibimport xmlrpc.client
    import DocXMLRPCServer
    +import SimpleXMLRPCServer
    import xmlrpc.server
    + +
      +
    1. ...
    2. +
    3. ...
    4. +
    + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NotesPython 2Python 3
    import httplibimport http.client
    import Cookieimport http.cookies
    import cookielibimport http.cookiejar
    import BaseHTTPServer
    +import SimpleHTTPServer
    +import CGIHttpServer
    import http.server
    + +
      +
    1. ...
    2. +
    3. ...
    4. +
    5. ...
    6. +
    7. ...
    8. +
    + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NotesPython 2Python 3
    import urllibimport urllib.request, urllib.parse, urllib.error
    import urllib2import urllib.request, urllib.error
    import urlparseimport urllib.parse
    import robotparserimport urllib.robotparser
    from urllib import FancyURLOpener
    +from urllib import urlencode
    from urllib.request import FancyURLOpener
    +from urllib.parse import urlencode
    from urllib2 import Request
    +from urllib2 import HTTPError
    from urllib.request import Request
    +from urllib.error import HTTPError
    + +
      +
    1. ...
    2. +
    3. ...
    4. +
    5. ...
    6. +
    7. ...
    8. +
    9. ...
    10. +
    11. ...
    12. +
    + +
    +

    filter() global function

    @@ -893,237 +1124,6 @@ except:
    -
    -

    imports

    - -

    FIXME intro

    -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NotesPython 2Python 3
    import StringIO
    -import cStringIO
    import io
    import cPickleimport pickle
    import __builtin__import builtins
    import copy_regimport copyreg
    import Queueimport queue
    import SocketServerimport socketserver
    import ConfigParserimport configparser
    import reprimport reprlib
    import commandsimport subprocess
    - -
      -
    1. ...
    2. -
    3. ...
    4. -
    5. ...
    6. -
    7. ...
    8. -
    9. ...
    10. -
    11. ...
    12. -
    13. ...
    14. -
    15. ...
    16. -
    17. ...
    18. -
    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NotesPython 2Python 3
    import dbmimport dbm.ndbm
    import gdbmimport dbm.gnu
    import dbhashimport dbm.bsd
    import dumbdbmimport dbm.dumb
    import anydbm
    -import whichdb
    import dbm
    - -
      -
    1. ...
    2. -
    3. ...
    4. -
    5. ...
    6. -
    7. ...
    8. -
    9. ...
    10. -
    - -

    - - - - - - - - - - - - - - - - -
    NotesPython 2Python 3
    import xmlrpclibimport xmlrpc.client
    import DocXMLRPCServer
    -import SimpleXMLRPCServer
    import xmlrpc.server
    - -
      -
    1. ...
    2. -
    3. ...
    4. -
    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NotesPython 2Python 3
    import httplibimport http.client
    import Cookieimport http.cookies
    import cookielibimport http.cookiejar
    import BaseHTTPServer
    -import SimpleHTTPServer
    -import CGIHttpServer
    import http.server
    - -
      -
    1. ...
    2. -
    3. ...
    4. -
    5. ...
    6. -
    7. ...
    8. -
    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NotesPython 2Python 3
    import urllibimport urllib.request, urllib.parse, urllib.error
    import urllib2import urllib.request, urllib.error
    import urlparseimport urllib.parse
    import robotparserimport urllib.robotparser
    from urllib import FancyURLOpener
    -from urllib import urlencode
    from urllib.request import FancyURLOpener
    -from urllib.parse import urlencode
    from urllib2 import Request
    -from urllib2 import HTTPError
    from urllib.request import Request
    -from urllib.error import HTTPError
    - -
      -
    1. ...
    2. -
    3. ...
    4. -
    5. ...
    6. -
    7. ...
    8. -
    9. ...
    10. -
    11. ...
    12. -
    - -
    -

    lambda functions with multiple parameters