On Wed, Aug 18, 2010 at 7:38 AM, Lisandro Dalcin <[email protected]> wrote:
> On 18 August 2010 03:11, Stefan Behnel <[email protected]> wrote:
>>
>> It also poses problems for classes that must be cdef classes because they
>> wrap C values, as in pretty much all wrapper code.
>>
>
> cdef classes already are quite different. For example, instances do
> not get a __dict__, nor Cython provides any kind of support for these
> instances getting one (though I'm working on that).
>

While this is a good thing, it should come with a warning that it
disables many optimizations (e.g. cpdef methods without attribute
lookup).

>>  > Perhaps we should control this with a flag.
>>
>> I'm not a big fan at all of changing behaviour with flags, but I'm strictly
>> against doing it in cases where the resulting behaviour is not obvious.
>> It's absolutely not obvious to me that a flag to make a call to a regular
>> Python special method faster makes that method unavailable from Python
>> code. Such an impact is too easy to get missed by tests.
>
> I agree.

I wouldn't call it a "regular" special method :).

No, it's not obvious. But having in not there by default, and an entry
in the FAQ about why, with the flag (or even better, a visibility
decorator as Carl suggested) to make it visible, should be
understandable enough.

I still think that fast by default is better, as it's what most users
will want, and obvious when you need make it visible, but not obvious
when you need to make it fast.

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

Reply via email to