pointers.py icon indicating copy to clipboard operation
pointers.py copied to clipboard

Why

Open TKIPisalegacycipher opened this issue 3 years ago • 14 comments

Would you do this

TKIPisalegacycipher avatar Mar 11 '22 03:03 TKIPisalegacycipher

because why not?

ZeroIntensity avatar Mar 11 '22 08:03 ZeroIntensity

There isn't enough pain in this world.

JesseTG avatar Mar 21 '22 03:03 JesseTG

WHY?? I switched to python to avoid dealing with pointers.

prkhrv avatar Mar 21 '22 23:03 prkhrv

from pointers import to_ptr

to_ptr(19) <<= 21
print(9 + 10) # 21

ZeroIntensity avatar Mar 21 '22 23:03 ZeroIntensity

I'm sure there's some kind of regulatory agency for programmers, and as soon as I figure out what it is I'm going to report you to it.

JesseTG avatar Mar 23 '22 13:03 JesseTG

from pointers import to_ptr

to_ptr(19) <<= 21
print(9 + 10) # 21

I understand why now.

Delation avatar Mar 23 '22 16:03 Delation

ctypes is cool, though. I have used it a lot.

Tip: I note with approval you have avoided doing “from ctypes import *” as per the documentation examples. However, I find continually typing “ctypes.this” and “ctypes.that” to be quite tedious. So I shorten it using “import ctypes as ct” instead. Then references become “ct.this” and “ct.that”.

ldo avatar Jun 16 '22 21:06 ldo

my ide was saying that doing from ctypes import * was illegal as wildcard imports from library wasn't allowed, so i didn't bother trying to hassle with flake8 or mypy which would complain about it later

ZeroIntensity avatar Jun 16 '22 23:06 ZeroIntensity

It’s not illegal, but minimizing namespace pollution is a good idea.

ldo avatar Jun 16 '22 23:06 ldo

The world cannot be at peace!! Hence we have pointers😂😂

NewbCooder avatar Jun 23 '22 11:06 NewbCooder

Someone wrote a medium article describing how great this package is for writing faster code 😟. I'm sure this is being used in production somewhere.

DexterAntonio avatar Aug 17 '22 20:08 DexterAntonio

havent tried any benchmarks, but i doubt that this makes things any faster (other than c bindings, but that still has a lot of abstraction going on)

ZeroIntensity avatar Aug 17 '22 20:08 ZeroIntensity

Could this be used to implement linked lists?

tommyvo avatar Aug 18 '22 19:08 tommyvo

you can implement linked lists just fine without this

ZeroIntensity avatar Aug 18 '22 20:08 ZeroIntensity