Skip to main content

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 as malloc, c_free as free, strcpy, printf

ptr = malloc(3)
strcpy(ptr, "hi")
printf("%s\n", ptr)
free(ptr)

Features

  • Fully type safe
  • Pythonic pointer API
  • Bindings for the entire C standard library
  • 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

Metadata

Release files for pointers-clone.py 0.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pointers-clone.py 0.0.0
File Size Uploaded
pointers_clone.py-0.0.0.tar.gz 63.0 kB Details

Release files / pointers_clone.py-0.0.0.tar.gz

Download URL pointers_clone.py-0.0.0.tar.gz
Size 63.0 kB
Tags Source
SHA-256 checksum
How to use checksums
9f0bc5a2c58905f99c492686fd6317e1f28bd18b22bcdfbbd810f3f731e8f13a
BLAKE2b-256 checksum
How to use checksums
18e4b68d30e5a5f2a76bae4cbfa73a17f62d7e0c27c2d269133bcbab212655a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.0

Release history Release notifications | RSS feed

This release

0.0.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page