Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 914423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:42:58+00:00 2026-05-15T17:42:58+00:00

What are the current rules for writing python code that will pass cleanly through

  • 0

What are the current rules for writing python code that will pass cleanly through 2to3 and what are the practices that seem to be best suited to writing code that will not become mired forever in version 2.

I have read from the SciPy/NumPy forums that “100% test coverage” (unit testing) is important for many people, and I am not sure if that would apply to everybody. Certainly having a reasonable set of unit tests to try your code out with after conversion, seems a sane step.

Are there other things? What are skilled Pythonistas doing if they are writing 2.x code that they hope to have come through “cleanly” in the 2to3 process.

I am looking for specific instances of “[don’t] do this” as well as some more general “best-practices”, but specific instances of “do’s and don’ts” are helpful.

Let’s assume that frameworks, libraries (Django, SciPy/NumPy), and every other C Extension we need gets ported to Python3 eventually, and I’m asking about how you write and maintain the pure python language code that you write yourself.

Update: It’s possible that what I really want is the “style guide” and list of deprecated features that everybody was already staying away from. I cut my teeth on Python 1.5 and moved to 2.0, and then have not really followed much of the 2.5/2.6 era, used them but really my code is more 2.1 era.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T17:42:58+00:00Added an answer on May 15, 2026 at 5:42 pm

    I’d say:

    • Read the “What’s new for Python 3.0“. Very informative.
      • In particular, if you care about Unicode or text encodings at all, take the time to understand what has changed for 3.x. That’s probably one of the trickier things to change for Python 3.x.
    • Get Python 2.6 or 2.7, and run your code with the -3 flag. It will tell you about things in your code that will need changing.
    • Before using 3rd-party packages, check to see if they have a Python 3.x version. If not, check the package web site, mailing lists, version control repositories etc to see how actively the package is being developed and whether there is a roadmap towards Python 3.x support.
    • Download Python 3.x and try it out! Admittedly, that might not be practical if you care about code that currently depends on packages that don’t yet support Python 3.x (e.g. wxPython or Django).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing an Android application that will run on phones and Honeycomb tablets,
In writing some code today, I have happened upon a circumstance that has caused
Current requirement is on button click I am getting a json data through ajax
current code (not working): /^script\s*type=\text\/javascript/i.test(tagName)
current code I've built function to do something over collection of jQuery elements: var
How compatible / compliant is sharepoint with current accessibility rules. Also how compliant is
I'm writing a small web application that keeps track a number of tickets. The
I'm writing an app that raises events, similar to how Phil Windley's personal data
I would like to reuse code by writing a proto transform which is templated
I have the current rewrite rules. RewriteCond %{HTTP_HOST} ^([^\.]+)\.domain\.com$ [NC] RewriteCond %{HTTP_HOST} !^www\. [NC]

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.