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

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — batch-change-examples/python/python-refactor at main · sourcegraph/batch-change-examples

Expand file tree

/

python-refactor

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

python-refactor

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
README.md
README.md
 
 
python-refactor.yaml
python-refactor.yaml
 
 

README.md

Outline

Refactoring Python 2 code to Python 3 with 2to3

This batch change is an example of how to use 2to3 to refactor Python 2 code into Python 3. The Python docs have more information on 2to3. This will:

  • Find repositories using Python 2-style print statments, with Python-language files in them.
  • Install 2to3 in the container.
  • Run 2to3 on the respositories that Sourcegraph finds.

How to

  • If running this issue on your own code, you may want to adjust the repositoriesMatchingQuery to just look for repositories containing Python code, rather than using the Python 2-style print statement as an indicator of Python 2 code. You may also want to adjust the repository exclusions (-repo:python-language-server -repo:ctags) to meet your needs, and may wish to exclude forks by removing fork:yes.
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.