Metadata-Version: 2.1
Name: pointers.py
Version: 1.3.8
Summary: Bringing the hell of pointers to Python.
Author: ZeroIntensity
Author-email: <zintensitydev@gmail.com>
License: MIT
Project-URL: Source, https://github.com/ZeroIntensity/pointers.py
Project-URL: Documentation, https://pointerspy.netlify.app/
Keywords: python,pointers
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: Implementation :: CPython
Description-Content-Type: text/markdown
License-File: LICENSE

# pointers.py

![Tests](https://github.com/ZeroIntensity/pointers.py/actions/workflows/tests.yml/badge.svg)

## Bringing the hell of pointers to Python

Why would you ever need this

-   [Documentation](https://pointerspy.netlify.app/)
-   [Repository](https://github.com/ZeroIntensity/pointers.py)
-   [PyPI](https://pypi.org/project/pointers.py)

### Example

```py
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 bindings

```py
from pointers import fopen, fprintf, fclose

file = fopen("/dev/null", "w")
fprintf(file, "hello world")
fclose(file)
```

### 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
```

### Running Documentation

```
$ git clone https://github.com/ZeroIntensity/pointers.py && cd pointers.py
$ pip install -U mkdocs
$ mkdocs serve
```


