An import hook for Python 3 that removes u prefixes from Python source code before compiling it.
Project description
The uprefix module provides an import hook for Python 3 which removes ‘u’ prefixes on Unicode literal strings in Python source code.
It is intended to assist users when porting Python 2.x code to 3.x.
There’s no separate documentation - all you need is given below.
Requirements & Installation
The uprefix module requires Python 3.1 or greater, and can be installed with the standard Python installation procedure:
python setup.py install
There is a set of unit tests which you can invoke with
python setup.py test
before running the installation.
Usage
Once installed on the path, the import hook is invoked as follows:
>>> import uprefix >>> uprefix.register_hook()
You can unregister the hook by
>>> uprefix.unregister_hook()
The latest version of uprefix can be found at
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file uprefix-0.1.tar.gz
.
File metadata
- Download URL: uprefix-0.1.tar.gz
- Upload date:
- Size: 12.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6020d025e92a8513fc4c117ebdfe47294aed530b887c4b43115d9ae3f2ac1cf2 |
|
MD5 | 9407b2d7aa1a574be7a61bde3af2d762 |
|
BLAKE2b-256 | d0e414c293c7f46921df4d69a4310731ef1ca970db7a2a676a9d929c1caa0871 |