GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Python Wiki
  • PSF Wiki
  • Jython Wiki
  • Python Wiki
  • Python 3 Migration

This view

  • Original page
  • New address

GeezerVison is showing wiki.python.org — Py3k Conversion Tools

View as Markdown

Py3k Conversion Tools¶

Legacy Wiki Page

This page was migrated from the old MoinMoin-based wiki. Information may be outdated or no longer applicable. For current documentation, see python.org.

Converting Python 2.x code to Python 3.x code


Since Python 2.6, Python has include a standard tool 2to3 to assist in the conversion. http://docs.python.org/library/2to3.html

Program features that need to be changed

  • has_key changed to x in dict

  • apply() removed

  • reduce() changed to functools.reduce()

Infrastructure for automatic refactoring

  • tokenize module

  • Python 2.5 compile() return ast objects

Previous
Porting to Py3k
Next
Py3k Deprecated
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.