Bringing the hell of pointers to Python.
Project description
pointers.py
Bringing the hell of pointers to Python
Why would you ever need this
Example
from pointers import to_ptr, Pointer, decay
a: str = '123'
b: str = 'abc'
@decay
def move(ptr_a: Pointer[str], ptr_b: Pointer[str]):
ptr_a <<= ptr_b
move(a, b)
print(a, b) # abc abc
Example with malloc
from pointers import malloc, free
memory = malloc(52)
memory <<= "abc"
print(*memory) # abc
free(memory)
print(*memory) # MemoryError
Why does this exist?
The main purpose of pointers.py is to simply break the rules of Python, but has some other use cases:
- Can help C/C++ developers get adjusted to Python
- Provides a nice learning environment for programmers learning how pointers work
- Makes it very easy to manipulate memory in Python
- Why not?
Installation
Linux/macOS
python3 -m pip install -U pointers.py
Windows
py -3 -m pip install -U pointers.py
Running Documentation
$ git clone https://github.com/ZeroIntensity/pointers.py && cd pointers.py
$ pip install -U mkdocs
$ mkdocs serve
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
pointers.py-1.1.6.tar.gz
(6.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pointers.py-1.1.6.tar.gz.
File metadata
- Download URL: pointers.py-1.1.6.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.22.0 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.1 keyring/18.0.1 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c04f0d79419de2041ab0098b0bba06ff29e279774ef314d6efcc087149f15dad
|
|
| MD5 |
a0e882ed1680be30066aa6246b41c1cb
|
|
| BLAKE2b-256 |
c5f589e89900d56ec161f335671cccede42fb053fbd810b6be3ed579fb0559a1
|
File details
Details for the file pointers.py-1.1.6-py3-none-any.whl.
File metadata
- Download URL: pointers.py-1.1.6-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.22.0 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.1 keyring/18.0.1 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26f71c8a7a420df405107f7e3ff09bf9c5e195d4db36f3864e88df2c68bf18a9
|
|
| MD5 |
8fbe057160888aa5a024261a496be064
|
|
| BLAKE2b-256 |
1035f4b407b3be5438cdcd61d7ed58750515e37aae918a95df83176afdd86274
|