Prothon gets Major Facelift in Vers 0.1.0 [Prothon]

gabor gabor at z10n.net
Sun May 23 12:19:02 EDT 2004


On Sun, 2004-05-23 at 09:25 -0400, Roy Smith wrote:
> Peter Hansen <peter at engcorp.com> wrote:
> > If by "C++ brigade" you mean "programmers who think C++ does
> > things the right way" then the only way to get them to take
> > Python seriously will be either (a) to change Python into
> > something that closely resembles C++, or (b) to change those
> > programmers so that their thinking fits Python better.
> 
> The world doesn't need another language that looks like C++.  Java 
> already fills that niche quite nicely.
> 
> > Merely adding "proper encapsulation" (and I happen to believe
> > Python already has encapsulation that is quite proper) will
> > not suffice.  And that's a good thing, too.... ;-)
> 
> Given that C++ has pointers and typecasts, it's really hard to have a 
> serious conversation about type safety with a C++ programmer and keep a 
> straight face. 


hmmm...i understand that you can cast away const,
but what about...

class C
{
	private x;
};

(i hope it's correct c++ (i haven't written c++ in the last 2years)).

so, how can you write to that variable from the outside?

ok, you can take the address of an instance, cast it to (int*) and
somehow calculate the address of C.x .but it's very dangerous,because a
different compiler can compile it to a different thing and so on...

so, except the pointer+offset algo detailed above (which i consider
highly unpropable to happen), how can an user of my class/library access
that variable?

gabor

p.s: just for the record.no, i don't like c++. yes,i would like to have
private variables in python. no, i don't like perl => i don't want to
prefix all my private vars with _.





More information about the Python-list mailing list