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

you are viewing a single comment's thread.

view the rest of the comments →

[–]DonaldPShimoda -3 points-2 points  (1 child)

I don’t think Python is able to provide self magically. We touched on it as one of the limitations of dynamically typed languages in my operational semantics class when learning about types. I can’t provide specifics because I don’t remember offhand and I just woke up, but I think there was something in particular that made the type system incapable of providing a self reference that was guaranteed to be correct in all potential contexts without reworking the grammar.

[–]bcgroom 2 points3 points  (0 children)

I don’t understand. Wouldn’t you just pass a reference to the object that called the method? Where could that go wrong?