On Sat, Jul 10, 2010 at 2:45 PM, Dag Sverre Seljebotn
<[email protected]> wrote:
> On 07/10/2010 09:11 PM, Stefan Behnel wrote:
>> Robert Bradshaw, 09.07.2010 17:29:
>>
>>> For the moment, though, I'm wondering why we even bother letting
>>> people declare the type as bool--it's not a very useful (Python) type
>>> to statically declare, but can cause a lot of confusion.
>>>
>> Agreed, use cases are hard to come up with. However, given that it's there,
>> I'd prefer keeping the C++ type in a separate namespace for now and
>> maybe(!) improve Cython warnings to find common traps when compiling in C++
>> mode.
>>
>
> But int and float has the exact same problem! And there we inherited C
> semantics from Pyrex...

And, for Py2, long has a double meaning as well. There is very little
use (currently) for declaring things to be Python ints, longs, floats,
bools.

> Therefore C++ bool makes sense IMO, to be consistent with int and float

Yep. The main problem that I see is that most of the usecases for bool
will be wrong, resulting in compiling, running code that does the
wrong thing. I'd rather not have the type at all.

> (but I'd like to see a new solution that doesn't confuse Python
> programmers at some point, both for bool, int and float).

Sure.

- Robert
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to