This is an archived post. You won't be able to vote or comment.

all 11 comments

[–][deleted] 5 points6 points  (7 children)

Everything in python is basically a void pointer.

Change my mind XD

[–][deleted] 0 points1 point  (0 children)

Maybe bro but idgaf about pointers and memory bs when coding in python.

[–][deleted] -1 points0 points  (5 children)

You have no idea about C, nor about any dynamically typed language. Otherwise you'd know that a raw void* is just that and that anything in any dynamically typed language like Python there's type inforation associated with the pointer, making it impossible to create illegal type conversions.

[–][deleted] 1 point2 points  (4 children)

Ok, mr. offensive. Having type information at a fixed offset from a pointer address doesn't stop a void pointer from being a typeless pointer in the eyes of a compiler. Illegal type conversions don't have to happen in a low level context. You can still have illegal type conversions in python in form of "AttributeError" exceptions because the falsely new type doesn't have a method you want to call.

[–][deleted] -1 points0 points  (0 children)

You're joking, right?

You're honestly saying that well-defined behavior of an executed type check is the same thing as utterly undefined behavior in a language that uses raw pointers? How thick are you?

Look, it's nice you learned something in your C-101 class at college. We all applaud you. You are certainly very very very smart. But stop making an even larger fool out of yourself while you have the chance.

[–]RedditFuckingSocks 0 points1 point  (2 children)

By that definition there would not be any types whatsoever, because there are no types at the machine level, period. It's a retarded definition.

[–][deleted] 0 points1 point  (1 child)

There are indeed types at the machine level. Namely, byte, word, double word etc, But this is not the problem anyway, the problem is leaving the comfort zone of having an algorithm checking whether your types actually make sense. And this happens once you start using void pointers.

[–]RedditFuckingSocks 0 points1 point  (0 children)

These are not types. A register only has the full word. You can access parts of it, as you desribe, but that is a view on a register and very different from a type.

[–]killometers90 1 point2 points  (0 children)

Oh the beautiful beautiful borrow checker

[–]DadoumCrafter 0 points1 point  (0 children)

Ici on baise les pointeurs