Antoine Pitrou <[EMAIL PROTECTED]> added the comment: Hello Matt,
> OK I implemented the defaultdict solution. I got curious so ran some > rough speed tests, using the following code. > > import random, urllib.parse > for i in range(0, 100000): > str = ''.join(chr(random.randint(0, 0x10ffff)) for _ in range(50)) > quoted = urllib.parse.quote(str) I think if you move the line defining "str" out of the loop, relative timings should change quite a bit. Chances are that the random functions are not very fast, since they are written in pure Python. Or you can create an inner loop around the call to quote(), for example to repeat it 100 times. cheers Antoine. _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3300> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com