On Mon, May 4, 2009 at 12:23 PM, Mike Hansen <mhan...@gmail.com> wrote:
>
> On Mon, May 4, 2009 at 12:19 PM, Jaap Spies <j.sp...@hccnet.nl> wrote:
>> Another Python builtin is pow(), but how is it possible that
>> type(pow(2,9,11)) returns
>> <type 'sage.rings.integer_mod.IntegerMod_int'>
>>
>> Or am I mistaken?
>
> The pow() builtin just calls __pow__ on the first argument in that
> case, which we control so we can return one of our types.  len() will
> call __len__, but forces whatever is returned to be an int.  This is
> what will be changing in Python 3.0.

However that change will in now way help with the original question.
Even in python 3.0 the len(...) of a list is still a Python int.

wst...@sage:~$ python3.0
Python 3.0 (r30:67503, Jan 23 2009, 04:39:45)
[GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> type(len([1,2,3,4]))
<class 'int'>

William

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to