[issue1106] Error in random.shuffle

2007-09-04 Thread Vizcaynot

New submission from Vizcaynot:

In python 3.0a1 under Win XP SP2:
Typing next code:

import random
s=range(10)
random.shuffle(s)

I have next error:
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\python30\lib\random.py", line 262, in shuffle
x[i], x[j] = x[j], x[i]
TypeError: 'range' object does not support item assignment

It does not happen in python 2.5

--
components: Library (Lib)
messages: 55653
nosy: Viscaynot
severity: normal
status: open
title: Error in random.shuffle
type: crash
versions: Python 3.0

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1106>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1092] Unexpected results in Tutorial about Unicode

2007-09-04 Thread Vizcaynot

Vizcaynot added the comment:

Thanks about the fixing info.
In relation to the second issue, I am afraid it is my fault, the value 
of variable "a" was asigned and filled with a previous valid operation. 
Please forgive me for the time you spent unnecessarily. I will attempt 
to be careful in the future.  :-(

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1092>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1092] Unexpected results in Tutorial about Unicode

2007-09-02 Thread Vizcaynot

New submission from Vizcaynot:

When trying the tutorial example about unicode  I have:
>>> "Äpfel".encode('utf-8')
  File "", line 1
SyntaxError: (unicode error) unexpected code byte

I live in a latin american country so I need to do:
>>> "Äpfel".decode('latin-1).encode('utf-8')
  File "", line 1
>>>
but the indentation " >>>" is new for me, so I attempt the next:
>>> a="Äpfel".decode('latin-1).encode('utf-8')
  File "", line 1
>>> a
b'\xc3\x84pfel'
>>> print (a)
Äpfel
>>>

Is this necessary to do correction to the tutorial? is this normal the 
presence of "   >>>" that appears indented once I assign the value to 
variable a?
Thanks!!

--
components: Unicode
messages: 55598
nosy: Viscaynot
severity: normal
status: open
title: Unexpected results in Tutorial about Unicode
type: behavior
versions: Python 3.0

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1092>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com