Skip to main content

MagicalPython

ItsThatOneJack, Copyright, All Rights Reserved Unless Stated Otherwise. Follow the license!

MagicalPython — I originally wanted to call it Python++ :c


License License


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

  • Result type (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 called q.
  • 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

Metadata

Release files for magicalpython 0.2.2

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

Source distribution (sdist)

Source distribution for magicalpython 0.2.2
File Size Uploaded
magicalpython-0.2.2.tar.gz 320.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for magicalpython 0.2.2
File Interpreter ABI Platform
magicalpython-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 393.1 kB

Release files / magicalpython-0.2.2.tar.gz

Download URL magicalpython-0.2.2.tar.gz
Size 320.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3e553f5d8006f82680b6bf0be5b01dc0f35b776dbb746b589973b51c08778d3d
BLAKE2b-256 checksum
How to use checksums
2784b0b2c28e3020113083aa3ef3fb895267cf5aed6f7c13964d5fd56500ae5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.8

Release files / magicalpython-0.2.2-py3-none-any.whl

Download URL magicalpython-0.2.2-py3-none-any.whl
Size 72.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b76d10a2260b7b330be9230d2fcd11ccc0ddd38e45649337961e8557ae09e90
BLAKE2b-256 checksum
How to use checksums
a2c4759174af6a04c9d17661aae1b98ddd0c32b457c488436c445a04b5247ff1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.8

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.0.1

2 release files

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