Skip to main content

No project description provided

Project description

pointers.py

Tests

Bringing the hell of pointers to Python

Why would you ever need this

Examples

from pointers import _

text: str = "hello world"
ptr = _&text  # creates a new pointer object
ptr <<= "world hello"
print(text)  # world hello
from pointers import c_malloc, c_free, strcpy, printf

ptr = c_malloc(3)
strcpy(ptr, "hi")
printf("%s\n", ptr)  # hi
c_free(ptr)
from pointers import malloc, free

my_str = malloc(103)
my_str <<= "hi"
second_str = my_str[51]
second_str <<= "bye"
print(*my_str, *second_str)  # hi bye
free(my_str)

Features

  • Fully type safe
  • Pythonic pointer API
  • Bindings for the entire C standard library and CPython ABI
  • Segfaults

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pointers.py-3.0.1-cp312-cp312-win_amd64.whl (71.5 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

pointers.py-3.0.1-cp312-cp312-win32.whl (70.8 kB view hashes)

Uploaded CPython 3.12 Windows x86

pointers.py-3.0.1-cp312-cp312-musllinux_1_1_x86_64.whl (83.7 kB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.1+ x86-64

pointers.py-3.0.1-cp312-cp312-musllinux_1_1_i686.whl (83.1 kB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.1+ i686

pointers.py-3.0.1-cp312-cp312-musllinux_1_1_aarch64.whl (83.6 kB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.1+ ARM64

pointers.py-3.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (79.4 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

pointers.py-3.0.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (79.1 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pointers.py-3.0.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (78.4 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

pointers.py-3.0.1-cp312-cp312-macosx_10_9_x86_64.whl (68.4 kB view hashes)

Uploaded CPython 3.12 macOS 10.9+ x86-64

pointers.py-3.0.1-cp311-cp311-win_amd64.whl (71.5 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

pointers.py-3.0.1-cp311-cp311-win32.whl (70.7 kB view hashes)

Uploaded CPython 3.11 Windows x86

pointers.py-3.0.1-cp311-cp311-musllinux_1_1_x86_64.whl (83.1 kB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

pointers.py-3.0.1-cp311-cp311-musllinux_1_1_i686.whl (82.6 kB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ i686

pointers.py-3.0.1-cp311-cp311-musllinux_1_1_aarch64.whl (83.1 kB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ ARM64

pointers.py-3.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (78.8 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

pointers.py-3.0.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (78.4 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pointers.py-3.0.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (77.8 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

pointers.py-3.0.1-cp311-cp311-macosx_10_9_x86_64.whl (68.4 kB view hashes)

Uploaded CPython 3.11 macOS 10.9+ x86-64

pointers.py-3.0.1-cp310-cp310-win_amd64.whl (71.4 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

pointers.py-3.0.1-cp310-cp310-win32.whl (70.7 kB view hashes)

Uploaded CPython 3.10 Windows x86

pointers.py-3.0.1-cp310-cp310-musllinux_1_1_x86_64.whl (83.0 kB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

pointers.py-3.0.1-cp310-cp310-musllinux_1_1_i686.whl (82.6 kB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ i686

pointers.py-3.0.1-cp310-cp310-musllinux_1_1_aarch64.whl (83.1 kB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ ARM64

pointers.py-3.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (79.2 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

pointers.py-3.0.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (78.7 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pointers.py-3.0.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (78.1 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

pointers.py-3.0.1-cp310-cp310-macosx_10_9_x86_64.whl (68.3 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

pointers.py-3.0.1-cp39-cp39-win_amd64.whl (71.5 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

pointers.py-3.0.1-cp39-cp39-win32.whl (70.7 kB view hashes)

Uploaded CPython 3.9 Windows x86

pointers.py-3.0.1-cp39-cp39-musllinux_1_1_x86_64.whl (82.7 kB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

pointers.py-3.0.1-cp39-cp39-musllinux_1_1_i686.whl (82.3 kB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ i686

pointers.py-3.0.1-cp39-cp39-musllinux_1_1_aarch64.whl (82.8 kB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ ARM64

pointers.py-3.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (78.9 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

pointers.py-3.0.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (78.4 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pointers.py-3.0.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (77.8 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

pointers.py-3.0.1-cp39-cp39-macosx_10_9_x86_64.whl (68.3 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

pointers.py-3.0.1-cp38-cp38-win_amd64.whl (71.4 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

pointers.py-3.0.1-cp38-cp38-win32.whl (70.7 kB view hashes)

Uploaded CPython 3.8 Windows x86

pointers.py-3.0.1-cp38-cp38-musllinux_1_1_x86_64.whl (83.1 kB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ x86-64

pointers.py-3.0.1-cp38-cp38-musllinux_1_1_i686.whl (82.6 kB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ i686

pointers.py-3.0.1-cp38-cp38-musllinux_1_1_aarch64.whl (83.1 kB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ ARM64

pointers.py-3.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (79.6 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

pointers.py-3.0.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (79.1 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pointers.py-3.0.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (78.5 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

pointers.py-3.0.1-cp38-cp38-macosx_10_9_x86_64.whl (68.3 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

pointers.py-3.0.1-cp37-cp37m-win_amd64.whl (71.3 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

pointers.py-3.0.1-cp37-cp37m-win32.whl (70.5 kB view hashes)

Uploaded CPython 3.7m Windows x86

pointers.py-3.0.1-cp37-cp37m-musllinux_1_1_x86_64.whl (83.2 kB view hashes)

Uploaded CPython 3.7m musllinux: musl 1.1+ x86-64

pointers.py-3.0.1-cp37-cp37m-musllinux_1_1_i686.whl (82.7 kB view hashes)

Uploaded CPython 3.7m musllinux: musl 1.1+ i686

pointers.py-3.0.1-cp37-cp37m-musllinux_1_1_aarch64.whl (83.2 kB view hashes)

Uploaded CPython 3.7m musllinux: musl 1.1+ ARM64

pointers.py-3.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (78.7 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ ARM64

pointers.py-3.0.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (78.1 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pointers.py-3.0.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (77.6 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

pointers.py-3.0.1-cp37-cp37m-macosx_10_9_x86_64.whl (68.1 kB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

pointers.py-3.0.1-cp36-cp36m-win_amd64.whl (69.9 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

pointers.py-3.0.1-cp36-cp36m-win32.whl (69.1 kB view hashes)

Uploaded CPython 3.6m Windows x86

pointers.py-3.0.1-cp36-cp36m-musllinux_1_1_x86_64.whl (80.9 kB view hashes)

Uploaded CPython 3.6m musllinux: musl 1.1+ x86-64

pointers.py-3.0.1-cp36-cp36m-musllinux_1_1_i686.whl (80.4 kB view hashes)

Uploaded CPython 3.6m musllinux: musl 1.1+ i686

pointers.py-3.0.1-cp36-cp36m-musllinux_1_1_aarch64.whl (80.8 kB view hashes)

Uploaded CPython 3.6m musllinux: musl 1.1+ ARM64

pointers.py-3.0.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (77.3 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ ARM64

pointers.py-3.0.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (76.7 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pointers.py-3.0.1-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (76.2 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

pointers.py-3.0.1-cp36-cp36m-macosx_10_9_x86_64.whl (66.5 kB view hashes)

Uploaded CPython 3.6m macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page