Using C++ and ctypes together: a vast conspiracy? ;)

Roy Smith roy at panix.com
Wed Jun 3 09:05:35 EDT 2009


In article <mailman.1046.1244023834.8015.python-list at python.org>,
 "A. Cavallo" <a.cavallo at mailsnare.com> wrote:

> The following is the STL equivalent of:
> 
> print [ x*2 for range(10) in data if (x%2 == 0) ]

Are you sure about that?  I haven't tested the following code, but I 
believe it is a much more direct match the the behavior of your Python code 
(at least on Python 2.5.1).

#include <iostream>
int main(int argc, char * argv[])
{
    std::cout << "SyntaxError: can't assign to function call";
    std::cout << endl;
}



More information about the Python-list mailing list