Supporting Python 3¶
- About this book
- Foreword
- Welcome to Python 3
- Migration strategies
- Preparing for Python 3
- 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 you aren’t using any removed modules
- Testing coverage and tox
- Optional: Use the iterator-methods on dictionaries
- 2to3
- Common migration problems
- Improving your code with modern idioms
- Supporting Python 2 and 3 without 2to3 conversion
- Migrating C extensions
- Extending 2to3 with your own fixers