Supporting Python 3 (Python 3 supported)--Directory

Source: Internet
Author: User
Tags integer division

Supporting Python 3 (Python 3 supported)
  • About the book

      • About terminology

  • Order

  • Welcome to Python 3

      • Is it time now?

      • What if I can't switch now?

      • Python and its version

      • More Resources

  • Migration policy

      • Only Python 3 is supported

      • Separate branches for Python 2 and Python 3

      • Convert to Python using 2to3 3

        • Using distribute to support 2to3 conversions

      • No conversion support for Python 2 and Python 3

      • Using 3to2

      • What kind of strategy is right for you?

        • Application

        • Python Modules and Packages

        • Framework

      • Conclusion

  • Preparing for Python 3

      • Comparatively tricky

      • Implementing __HASH__ ()

      • Run under Python 2.7.

      • Use//instead of/when dividing integers

      • Use New-style classes

      • Separate binary data and strings

      • When sorting, use key instead of CMP

      • Use rich comparison operators

      • Make sure aren ' t using any removed modules

      • Testing coverage and Tox

      • Optional:use the Iterator-methods on dictionaries

  • 2to3

      • Running Tests with Distribute

      • Running 2to3 with Distribute

      • Running 2to3 on Install

      • Explicit Fixers

      • Using 2to3

      • Distributing packages

      • Supporting multiple versions of Python with distribute

  • Common Migration Problems

      • Write () has a return value

      • Types is now classes

      • Handling expected exceptions

      • String representation

      • Dict and set Order

      • Byte literals

      • Binary data in Python 2 and Python 3

      • Nicer Solutions

      • Manipulating binary data

      • Reading from files

      • Incorrect imports

      • Relative Import Problems

      • Unorderable types, __cmp__ and CMP

      • Sorting

      • Sorting Unicode

      • Bytes, Strings and Unicode

      • Replacing UserDict

      • CSV API Changes

      • Running doctests

  • Improving your code with modern idioms

      • Abstract base Classes

      • Multiprocessing and Futures

      • Numbers and fractions

      • Use sorted () instead of. Sort ()

      • Coding with context Managers

      • Advanced string Formatting

      • Class Decorators

      • Set literals

      • Yield to the generators

      • More comprehensions

      • The next Next ()

      • New Modules

  • Supporting Python 2 and 3 without 2TO3 conversion

      • Supporting the print () function

      • Handling Exceptions

      • Import errors

      • Integer incompatibilities

      • More bytes, strings and Unicode

      • The Times three is "six"

  • Migrating C Extensions

      • Before you start

      • Object initialization

      • Module initialization

      • Changes in Python

      • Strings and Unicode

  • Extending 2to3 with your own fixers

      • When fixers is necessary

      • The Parse Tree

      • Creating a fixer

      • Modifying the Parse Tree

      • Finding the nodes with Patterns

  • Language Differences and workarounds

      • Apply ()

      • Buffer ()

      • Callable ()

      • Classes

      • Comparisons

      • Coerce () and __coerce__

      • Dictionary methods

      • except

      • Exception objects

      • Exec

      • ExecFile

      • File

      • F Ilter ()

      • Imports

      • Indentation

      • Input () and raw_input ()

      • P>integer Division

      • Long

      • Map ()

      • metaclasses

      • . Next () /p>

      • Parameter unpacking

      • Print

      • Raise

      • Range () and xrange ()

      • repr () as backticks.

      • Rounding Behavior

      • Slice operator methods

      • Sorting

      • StandardError

      • String types

  • Reorganizations and Renamings

      • Urllib, Urllib2 and Urlparse

      • The standard library

      • Removed modules

      • Moved Builtins

      • String Module Removals

      • Function and Method attribute renamings


    Supporting Python 3 (Python 3 supported)--Directory

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.