From: Mark Hubbart Date: 2005-07-17T03:47:17+09:00 Subject: Re: `not' in parameter lists On 7/16/05, Daniel Brockman wrote: > I just noticed that all of the following give syntax errors: > > * assert not foo > > * assert not(foo) > > * assert(not foo) > > * assert(not(foo)) > > I would like them all to be equivalent to the following: > > assert !foo > > At the _very_ least, the fully-bracketed one should work, > but it would be great if they all worked. First, remember that 'not' is a keyword, not a method. So it won't work as a method call. However, it's true that you can't use it directly in parameter lists. You can get around it like this: assert((not foo)) The extra parens make the 'not foo' evaluate separately from the parameter list, and it works. cheers, Mark