Creates a regex-as-re-globally.pth to replace stdlib "re" module with "regex" module globally before any code runs.
Project description
regex-as-re-globally
This package does very unusual things, and you normally don't need it.
It helps you use the "regex" package which is a backwards-compatible replacement for re
, with additional features and better performance in some situations (and worse performance in others).
Normally you can put import regex as re
in your .py files and that's all you need.
However, if you want to use regex
instead of re
across your whole environment, even within 3rd-party libraries, then this package is for you.
Run pip install regex-as-re-globally
to install this package.
It will create a .pth file in site-packages which modifies sys.modules
so that regex
is used everywhere instead of re
.
This changes behavior within the whole python environment.
The wheel files generated are platform and python specific due to the limitations of wheel files, where the relative directory for site-packages needs to be determined at wheel building time, not install time. The directory is dependent on the version of python and the platform you are on.
The site-packages .pth technique is heavily inspired by https://github.com/dougn/coverage_pth and https://nedbatchelder.com/blog/201001/running_code_at_python_startup.html Thanks!
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 regex-as-re-globally-0.0.3.tar.gz
.
File metadata
- Download URL: regex-as-re-globally-0.0.3.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.27.1 setuptools/62.6.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d2beee25e72db147cc42fc81bd6a9f3331bd6a0c69e0881d6040f7c964278dc |
|
MD5 | 304e07a807b1818cfda755cc5c8e45e9 |
|
BLAKE2b-256 | 2cb66c6aa810ee11af46311587bd2cc40c285db58ceb70a6dd85bdf607eaced6 |