[Python-checkins] CVS: python/dist/src/Doc/lib libcrypt.tex,1.14,

Greg Stein gstein@lyra.org
Mon, 14 Feb 2000 17:17:17 -0800 (PST)

On Tue, 15 Feb 2000, Peter Funk wrote:
> Fredrik Lundh wrote:
> > > +         if cryptedpasswd == 'x' or cryptedpasswd == '*': 
> > 
> > in ("x", "*"):
> I must have programmed in Modula-2 and C for too long. :-(

Actually, it is arguable which is faster. Using the "in" form means that
you construct the tuple at runtime, then perform the "in" check. The
version using "or" is simply a couple comparisons.

In other words, it really comes down to which form is most readable. I
think Peter's original form using "or" is more readable. Fredrik's is
easier to extend to include more alternatives. Your call :-)


Greg Stein, http://www.lyra.org/