sebastian serrano [EMAIL PROTECTED] added the comment:
Running with python -O the timing gets a little closer between Lock and
RLock. This code won't be easy to improve in performance.
The heaviest call is current_thread(), used at lines:
117:me = current_thread()
137:if self.__owner
Why does Python give an error when I try to do this:
len(object=[1,2])
Traceback (most recent call last):
File pyshell#40, line 1, in module
len(object=[1,2])
TypeError: len() takes no keyword arguments
but not when I use a normal function:
def my_len(object):
return len(object)
On Oct 29, 3:10 pm, Duncan Booth [EMAIL PROTECTED] wrote:
Armando Serrano Lombillo [EMAIL PROTECTED] wrote:
Why does Python give an error when I try to do this:
len(object=[1,2])
Traceback (most recent call last):
File pyshell#40, line 1, in module
len(object=[1,2
On Oct 29, 3:20 pm, Bruno Desthuilliers bruno.
[EMAIL PROTECTED] wrote:
Armando Serrano Lombillo a écrit :
Why does Python give an error when I try to do this:
len(object=[1,2])
Traceback (most recent call last):
File pyshell#40, line 1, in module
len(object=[1,2])
TypeError
Hello again, I've investigated a little bit and this is what I found:
If I run IDLE and type
import sys
sys.stdin.encoding
I get
'cp1252'
But if I have a whatever.py file (it can even be a blank file), I edit
it with IDLE, I press F5 (Run Module) and then type:
import sys
Martin v. Löwis wrote:
[EMAIL PROTECTED] wrote:
This works if I use the console but gives the following error if I use
IDLE:
Traceback (most recent call last):
File C:\test.py, line 4, in ?
text2 = unicode(raw_input(), sys.stdin.encoding)
AttributeError: PyShell instance has
Hello, the following program prompts the user for a word and tests to
see if it is the same as another one. If the user types españa (note
that the word contains an 'ñ'), the program should output same. This
works if I run the code in IDLE but does not if I run it in the windows
console. Can
Fredrik Lundh wrote:
[EMAIL PROTECTED] wrote:
Hello, the following program prompts the user for a word and tests to
see if it is the same as another one. If the user types españa (note
that the word contains an 'ñ'), the program should output same. This
works if I run the code in IDLE