MagicalPython
MagicalPython — I originally wanted to call it Python++ :c
why?
/waɪ/ • adverb
Definition > For what reason, cause, or purpose; to what end. Used to question the motivation, justification, or necessity behind an action.
E.g.: "Why would you ever make that?"
I know what you are thinking: "Why would someone ever make this?" Well, the answer is "because I can." There are so many cautionary tales about the dangers of thinking about "why not" rather than "why" that nobody ever stops to actually think "I can make that, why shouldn't I?" I strive to change that.
That is why I made this monstrosity. Python with nearly everything nobody ever thought "why not!" about.
Features
Resulttype (you have to use it, literally every function will always return one).- Lazy errors (they don't raise immediately, but they can if you want them to).
- Rust's
?operator, except its a function calledq. - Fancy tracebacks.
- A fancy segfault message, for you Windows users out there.
- Inline assembly.
- Clobbers.
- Automatic ctype resolution.
- Introspection.
- Per-architecture and per-OS assembly.
- Memory stuff!
- Malloc & calloc.
- Automatic local/remote mode.
- Memory protection.
- C-style bitfields.
- Unions.
- Memory scanning, because we feel like a cheat written in this would be hilarious.
- AoB (Array of Bytes) scanning.
- Semi-automatic privilege escalation (via UAC on Windows or cached sudo creds on Linux/MacOS).
- CPU feature detection.
- Raw CPUID leaves, in case you want them.
- GCC-style
__builtins__. - Crash handler registration.
- Exit handler registration.
- Atomics (technically not atomic, but the only access to the memory you need an atomic for is within an atomic CPU instruction), so it counts.
- Spinlocks.
C Build Commands
Simply cd into the project root and run the Windows and then Linux/MacOS build commands, assuming you are on Windows.
Windows
gcc -shared -O2 -o src/native/segfault_msg.dll src/native/segfault_msg.c
Linux/MacOS
docker run --rm -v $"($env.PWD):/work" -w /work gcc:latest gcc -shared -fPIC -O2 -o src/native/segfault_msg.so src/native/segfault_msg.c
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 magicalpython-0.2.2.tar.gz.
File metadata
- Download URL: magicalpython-0.2.2.tar.gz
- Upload date:
- Size: 320.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e553f5d8006f82680b6bf0be5b01dc0f35b776dbb746b589973b51c08778d3d
|
|
| MD5 |
5b2bcccf21fcaccdd86c2418e0c91352
|
|
| BLAKE2b-256 |
2784b0b2c28e3020113083aa3ef3fb895267cf5aed6f7c13964d5fd56500ae5a
|
File details
Details for the file magicalpython-0.2.2-py3-none-any.whl.
File metadata
- Download URL: magicalpython-0.2.2-py3-none-any.whl
- Upload date:
- Size: 72.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b76d10a2260b7b330be9230d2fcd11ccc0ddd38e45649337961e8557ae09e90
|
|
| MD5 |
d93d3d6b39552e1e788d8fec1e5fad9c
|
|
| BLAKE2b-256 |
a2c4759174af6a04c9d17661aae1b98ddd0c32b457c488436c445a04b5247ff1
|