On Mon, Nov 17, 2014 at 10:53 AM, William Stein <wst...@gmail.com> wrote:
>
> On Nov 17, 2014 10:42 AM, "kcrisman" <kcris...@gmail.com> wrote:
>>>
>>>
>>> > Is there a reason we need to have our own version?
>>>
>>
>> Actually, I think there is, because see the original ticket #9675:
>>
>> I must say I detected some problems with Brian units related to the Sage
>> classes 'RealNumber?' and 'Integer', so I created a patch so that when Brian
>> is imported these two classes are redefined as follows:
>>
>> RealNumber=float
>> Integer=int
>>
>> This solves the problems.
>
> Wait....?  Are you really saying that if a user does
>
> Sage: import brian
> Sage: 2/3
>
> They now get 0?
>
> If so I'm -1 to this.

Same here, strongly.

> Best would be to fix brian so it works with sage ints
> and reals (and upstream the patches) or short of that to print a message
> suggesting the user type what you put above (with caveats)....
>
> Hard developer question: is there any way to hack python or cython to make
> it so our types appear to derive from int and float to solve this problem
> once and for all?  Has anybody seriously thought about this?

I've thought about it before, but it would mean that we'd have to
abandon Integer extending Element (unless we add support for multiple
inheritance with incompatible base types like C++, but I don't even
know if that's possible) and still would break people who use the
CheckExact macros.

I'd say this is a clear bug in brain to not respect Python duct-typed
numeric values.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to