Move Python things to other modules, mostly for backward-compatibility
Project description
pyjar
Move Python things to other modules, mostly for backward-compatibility, such as when you want to refactor your code but still need old pickles to be loadable, or particularly if you need the new pickles to be byte-for-byte-identical to the old ones.
installation
😄
You can pip install pyjar
if you really want to, but you can also just
copy this public-domain code from src/pyjar/__init__.py
directly into
your own project. You can even give it a name you like better.
usage
from pyjar import jar
@jar('.old_module_name)
def my_function_that_i_moved_here():
...
The function (or class, or whatever) will still be importable from its
new location, but it will pickle
as though it lives in the old
location. And as long as the module that defines the function itself
has been imported, old pickles pointing to the old location will
successfully unpickle.
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
Built Distribution
File details
Details for the file pyjar-0.1.1.tar.gz
.
File metadata
- Download URL: pyjar-0.1.1.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69cbe29abb55324dcdcda456cfbe10196dd9e754bdbcb666cb0f9ff2e0293cde |
|
MD5 | 72e3cd0ba3dc0aee0b4141c2fc150bd7 |
|
BLAKE2b-256 | dd0e68947d41b20e53c2410a56cfdb419876203bb3c49eb7314fea2441291848 |
File details
Details for the file pyjar-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: pyjar-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5c1538252e0f691e45ccdf1b2440731073a010e8207db66a776ba7fbe0d48df |
|
MD5 | d89e9e6e895b1930ed106c2500f42025 |
|
BLAKE2b-256 | 2399b26acad202ee30529921b173a57b93c73bf9366cca4e1063156b08ce45a4 |