[Cython] [Off-topic] Re: Proposed change to behaviour of "not None"

Dag Sverre Seljebotn dagss at student.matnat.uio.no
Thu Aug 21 23:11:55 CEST 2008


Dag Sverre Seljebotn wrote:
>As a fun aside, once you get into nested expressions like this:
> 
> if (a is not None and b is not None and c == 2) or (a is None and c == 1  ...
> 
> then we've got an instance of SAT (i.e. can't solve in polynomial time
> "unless P = NP"). But I think there's a rather natural cutoff point for
> the complexity of expressions we consider.
> 

Nope, I am now fairly sure that this is wrong. I now think it is 
polynomial time (as you only need to know whether a or b is forced to 
None or not-None in isolation without having to consider the other one).

But I digress (I love those few precious moments where 
NP-completeness-theory is useful in a real program though).

-- 
Dag Sverre


More information about the Cython-dev mailing list