James G. Sack (jim) wrote:

A const pointer to non-const data in python would be, (eg) like a list,
no? .. A const pointer at least so long as you didn't "reassign" a.

You're understanding is correct. The issue is that I want to be able to prevent/flag an error when you try to "reassign" a.

Basically, the question boils down to "What does "=" do?" and "Can I override "="?"

In C++, "=" operates on an existing object and returns a reference.

In Python, "=" operates on the namespace of variables and creates an association. In C++ terms, it is the equivalent to a declaration with an initializer.

I've been banging into the "edge" cases more and more often lately. Primarily because I'm wanting the language to bend to *my* will more often than I am willing to compensate for the language itself, nowadays.

I don't know if that is a good sign or a bad sign.

-a

--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to