Library functions to support pythonizer
Project description
perllib
Library functions to support pythonizer
Free software: GNU General Public License v3
Documentation: https://perllib.readthedocs.io.
Features
Perl library functions typically return 1 on success and undef on failure, whereas python library functions raise exceptions on failure. Also, perl automatically converts variables from strings to numbers and vice-versa when referenced in the appropriate context. In perl, global variables are truly global across files and are organized by package name, where in python global variables have file scope. In addition, perl has autovivification, which means that arrays and hash tables magically appear out of whole cloth when referenced. This library supports all of those features and allows the “pythonizer” perl to python translator generate code that is fairly readable.
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.966 (2022-03-20)
Convert variable to string in _substitute_global, _substitute_element, _translate_global, and _translate_element. Change _ref to handle object checks and add _refs to handle ref with to a scalar, array, or hash - not perfect but it’s normally correct. Add _bless and enable _init_package to handle classes. Fix _list_of_n and _make_list if you pass it a single Hash(). Add _flt for specific conversions to float, like in math functions. Implement select via _select. Implement kill via _kill.
0.965 (2022-03-14)
Change Config.Config to Config.Config_h and all Dumper variables to include _v suffix to match new package var mappings in Pythonizer. Add _map_int, _map_num, _map_str. Fix _flatten to handle multiple levels. Change _longmess traceback to return ‘()’ for args if they were changed to a list and all popped off instead of ‘[]’. Handle OUTPUT_FIELD_SEPARATOR and OUTPUT_RECORD_SEPARATOR in _perl_print. Fix charnames.viacode to handle ‘U+’ or ‘0x’ prefix.
0.964 (2022-03-10)
Fix _init_package for package with dotted name, don’t raise exceptions in -C, -A, -M, fix Array __setitem__ with slice
0.963 (2022-03-09)
Add _chop_global, _chomp_global, _chop_element, _chomp_element
0.962 (2022-03-09)
Hot fix for _fileinput_next - errors on Python older than v3.10
0.961 (2022-03-02)
Handle open layer pragmas, fix issue with translate and friends with squash option, add dclone, catfile, file_name_is_absolute, Dumper, don’t raise exception on double close
0.960 (2022-02-28)
Speed up ArrayHash and Num. Have add_element and subtract_element handle non-numeric elements, turn subprocess shell=False on windows unless the command contains cmd shell chars or is a cmd built-in, fixup open of /tmp/… on windows to use the windows tempdir, don’t pass effective_ids=True on windows. Have concat_element auto-convert everything to strings.
0.959 (2022-02-24)
str(ArrayHash()) changed to give ‘’ instead of [], add EVAL_ERROR global variable, have ArrayHash() + or += work on empty value
0.958 (2022-02-23)
Don’t give a close failed error on a pipe which got automatically closed, give empty result for keys(), values(), and items() on a fresh ArrayHash instead of AttributeError
0.957 (2022-02-22)
Add list_to_hash function to process key/value pairs
0.956 (2022-02-21)
Implement all options of translate (tr///)
0.955 (2022-02-19)
Fix split: A zero-width match at the beginning of EXPR never produces an empty field, fix bootstrapping issues
0.954 (2022-02-17)
Add -n: trace run, fix issue of scalar being initialized as an array
0.953 (2022-02-15)
First release on PyPI.
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 Distributions
File details
Details for the file perllib-0.966.tar.gz
.
File metadata
- Download URL: perllib-0.966.tar.gz
- Upload date:
- Size: 57.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66080d208fb04460ae909dd41539aca7666c1d2514b72f0726834656ba4b416f |
|
MD5 | cc3f2ebb10f4ff4c4ab5320bd28926e3 |
|
BLAKE2b-256 | 8f813a8a8d2a515159afea168ef278add4f148e744caab7b840439a175f4979a |
File details
Details for the file perllib-0.966-py3.10.egg
.
File metadata
- Download URL: perllib-0.966-py3.10.egg
- Upload date:
- Size: 97.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f6dd176730ce3f8c2805f747d6f30a07421c5903c437ac6b0249a87ec3e7179 |
|
MD5 | 1934286bb2fa748f2b4aa0c45565ab71 |
|
BLAKE2b-256 | 22fa6d3927a15c41af5448a85bc1912bdee33505aca0762a7fc990c155dce570 |
File details
Details for the file perllib-0.966-py2.py3-none-any.whl
.
File metadata
- Download URL: perllib-0.966-py2.py3-none-any.whl
- Upload date:
- Size: 49.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0524e639dc58a0049c524119eeed960acac9768e4f8c3b00ad5728864c177be4 |
|
MD5 | 5264b9371b5d3bcb25a0b3bbc7447e46 |
|
BLAKE2b-256 | 2d52d147c601b5de5193a3dc515164c7ef1eaca73c82df7815ee5425990e8189 |