On May 21, 8:34 pm, Dave Parker <[EMAIL PROTECTED]> wrote: > On May 21, 1:14 pm, MRAB <[EMAIL PROTECTED]> wrote: > > > I wonder whether "is" could be used both for "x is value" and "x is a > > type" without causing a problem: > > > If command is a string ... > > > If command is "quit" ... > > I think you are right. I like "If command is "quit" ...". For a user > who wasn't mathemetically inclined and was doing mainly string > manipulation, I think it might be easier to read than the equivalent > "If command = "quit" ...". By making them exactly equivalent, I can't > think of any confusion that might induce bugs. If you think of any > drawbacks, please let me know. > I've thought of one possible drawback: "a" and "an" can be used as variables, so the "is a" part might cause a problem. You'd need to check the parser to find out...
> Otherwise, I'll put it in the next > time I update the parser (probably this weekend). Thank you again for > your suggestions. -- http://mail.python.org/mailman/listinfo/python-list