James G. Sack (jim) wrote:
Andrew Lentvorski wrote:
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.


Could this be achieved by (one of the approaches to) implementing a
singleton construct? Maybe assisted by some object registration (and
validation) mechanism? Messy, eh?

Singleton, no. The issue isn't whether more than one object on the "right side" of the "=" exists. It's simply that assignment to the thing on the "left side" should be prohibited.

And, yes, if object registration starts being required, the cure winds up being worse than the disease.

Maybe python design philosophy is just too permissive for doing this
very well. Hmm wonder if 3.0 addresses this? (Er.. was that a pun?)

Dunno. It doesn't really have anything to do with "permissive". It's all about how you go about "variable definition".

-a

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

Reply via email to