Copy constructors

Peter Hansen peter at engcorp.com
Tue Aug 14 19:26:55 EDT 2001


Ng Pheng Siong wrote:
> 
> According to Erik Max Francis  <max at alcyone.com>:
> > Ng Pheng Siong wrote:
> > >     self.state = 1 - self.state
> >
> > Why not just
> >
> >       self.state = not self.state
> 
> Good point. "x = 1 - x" was what I used back in the days when I first
> encountered programming and Basic. Does "x = not x" work in Basic? I no
> longer remember... (Presumably so.)

I don't really remember, but like you I used that only back
in the days of BASIC.  I think BASIC would often use -1 for
TRUE, so I don't remember whether x = 1 - x really produced 
values that were testable as booleans, or whether we always
had to make it explicit with "IF x = 1 THEN GOSUB 1000".
Does that mean BASIC had the "better explicit than implicit"
part of Python years before?  Guido stole from BASIC!  The nerve!
;)
-- 
----------------------
Peter Hansen, P.Eng.
peter at engcorp.com



More information about the Python-list mailing list