On Jun 28, 2007, at 6:06 PM, Martin Albrecht wrote:

>
>> Hmmm I don't know if I like this. Well, I don't have any objections
>> to such a method being available, but I prefer the name "binary" to
>> have the current behaviour. It's more pythonic, like the hex  
>> function.
>
> But there is no binary/bin function. I understand that __hex__  
> returns a
> string to obey Python conventions but binary() is our addition.  
> Also, if you
> are after a binary representation of an integer in SAGE you  
> probably want to
> do calculations with it, so a tuple/list/iterable of bits seems  
> more natural
> to me.

 >>> oct(34)
'042'

 >>> hex(34)
'0x22'

It just feels weird to me, even if we are adding binary() ourselves,  
to go against the grain here.

Although, to make a point on your side, both the oct and hex  
functions return a representation which matches python's input syntax  
for octal and hex, and the binary string representation doesn't (and  
can't) do that.

David


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to