Re: Recursive Property of Octal Numbers

2005-10-03 Thread Tim Roberts
James Stroud <[EMAIL PROTECTED]> wrote:
>
>I'm very curious about what is going on here. I'm sure my curiosity has 
>something to do with ignorance of some fundamental concept of computer 
>science (maybe that 8 is just a vertical infinity?):
>
>py> b = '\xb6'

8 doesn't have anything to do with it.  What you have there is hexadecimal.
0377 is an example of an octal number.

However, as was pointed out elsewhere, the same thing would be true even if
you used 'z'.
-- 
- Tim Roberts, [EMAIL PROTECTED]
  Providenza & Boekelheide, Inc.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Recursive Property of Octal Numbers

2005-10-01 Thread Dan Christensen
James Stroud <[EMAIL PROTECTED]> writes:

> I'm very curious about what is going on here. I'm sure my curiosity has 
> something to do with ignorance of some fundamental concept of computer 
> science (maybe that 8 is just a vertical infinity?):
>
> py> b = '\xb6'
> py> b[0]
> '\xb6'
> py> b[0][0]
> '\xb6'

Maybe this clarifies things?

>>> b='a'
>>> b[0]
'a'
>>> b[0][0]
'a'
>>> b[0] == b
True

Dan
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Recursive Property of Octal Numbers

2005-10-01 Thread Paul Rubin
James Stroud <[EMAIL PROTECTED]> writes:
> I'm very curious about what is going on here. I'm sure my curiosity has 
> something to do with ignorance of some fundamental concept of computer 
> science (maybe that 8 is just a vertical infinity?):

Python doesn't have a character type.  A character is just a string of
length 1.  So 'a'[0] is the same as 'a'.  Thus 'a'[0][0][0]...[0] is
also the same as 'a'.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Recursive Property of Octal Numbers

2005-10-01 Thread PoD
On Fri, 30 Sep 2005 15:40:51 -0700, James Stroud wrote:

> I'm very curious about what is going on here. I'm sure my curiosity has 
> something to do with ignorance of some fundamental concept of computer 
> science (maybe that 8 is just a vertical infinity?):
> 
> py> b = '\xb6'
> py> b[0]
> '\xb6'
> py> b[0][0]
> '\xb6'
> py> b[0][0][0]
> '\xb6'
> py> b[0][0][0][0]
> '\xb6'
> py> b[0][0][0][0][0]
> '\xb6'
> 
> 
> 
> James

b is a 1 character string.
b[0] is a one character string which is the first character of b.
Therefore b[0] == b.

-- 
http://mail.python.org/mailman/listinfo/python-list


Recursive Property of Octal Numbers

2005-10-01 Thread James Stroud
I'm very curious about what is going on here. I'm sure my curiosity has 
something to do with ignorance of some fundamental concept of computer 
science (maybe that 8 is just a vertical infinity?):

py> b = '\xb6'
py> b[0]
'\xb6'
py> b[0][0]
'\xb6'
py> b[0][0][0]
'\xb6'
py> b[0][0][0][0]
'\xb6'
py> b[0][0][0][0][0]
'\xb6'



James

-- 
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095

http://www.jamesstroud.com/
-- 
http://mail.python.org/mailman/listinfo/python-list