[issue3001] RLock's are SLOW

2008-06-21 Thread sebastian serrano
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

Built-in functions and keyword arguments

2007-10-29 Thread Armando Serrano Lombillo
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)

Re: Built-in functions and keyword arguments

2007-10-29 Thread Armando Serrano Lombillo
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

Re: Built-in functions and keyword arguments

2007-10-29 Thread Armando Serrano Lombillo
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

Re: Unicode, command-line and idle

2006-04-11 Thread a . serrano
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

Re: Unicode, command-line and idle

2006-04-07 Thread a . serrano
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

Unicode, command-line and idle

2006-04-06 Thread a . serrano
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

Re: Unicode, command-line and idle

2006-04-06 Thread a . serrano
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