[issue6126] Python 3 pdb: shows internal code, breakpoints don't work

2009-08-11 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Reading this patch, is it normal that the file is opened in text mode
without an encoding specified? What if the source file uses a different
encoding than the default system one?

--
nosy: +pitrou

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6126
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6126] Python 3 pdb: shows internal code, breakpoints don't work

2009-08-11 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

That's a good question :)

A quick test shows that exec() does honor coding cookies in code given
as a bytestring, so simply changing to open(..., rb) should be fine.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6126
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6656] locale.format_string fails on escaped percentage

2009-08-11 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

I fixed this a different way that seems cleaner.  In the process, I
discovered that passing a mapping argument to format_string is
completely broken.  Here is an expanded set of tests that demonstrate
this.  This diff is against trunk.

--
assignee:  - r.david.murray
nosy: +r.david.murray
priority:  - normal
type:  - behavior
versions: +Python 2.7, Python 3.1, Python 3.2 -Python 2.5
Added file: http://bugs.python.org/file14690/locale-tests.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6656
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6656] locale.format_string fails on escaped percentage

2009-08-11 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Here is a patch against trunk that fixes both the mapping handling and
the % escape handling.

The thing that worries me about this patch is that there are (obviously)
not a comprehensive set of tests proving that format_string actually
behaves like % formatting does.  So my refactoring could have broken
other behavior and I wouldn't know it.  However, since % formatting is
effectively depricated, I'm not sure how much effort it is worth putting
in to this

--
keywords: +needs review
stage:  - patch review
Added file: http://bugs.python.org/file14691/locale-fix.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6656
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2504] Add gettext.pgettext() and variants support

2009-08-11 Thread Mitar

Mitar mmi...@gmail.com added the comment:

I would just like to add that I am also looking forwards to this feature.

--
nosy: +mitar

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2504
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2009-08-11 Thread Vlastimil Brom

Vlastimil Brom vlastimil.b...@gmail.com added the comment:

Sorry for the dumb question, which may also suggest, that I'm 
unfortunately unable to contribute at this level (with zero knowledge 
of C and only working one for Python):
Where can I find the sources for tests etc. and how they are eventually 
to be submitted? Is some other account needed besides the one for 
bugs.python.org?

Anyway, the long character properties now work in the latest version 
issue2636-20090810#3.zip

In the mentioned overview 
http://www.regular-expressions.info/unicode.html
there is a statement for the property names: You may omit the 
underscores or use hyphens or spaces instead. 
While I'm not sure, that it is a good thing to have that many 
variations, they should probably be handled in the same way.

Now, the whitespace (and also non ascii characters) in the property 
name seem to confuse the parser: these pass silently (don't match 
anything) and don't throw an exception like undefined property name.

cf.

 regex.findall(ur\p{Dummy Property}, uabcDEF)
[]
 regex.findall(ur\p{DümmýPrópërtý}, uabcDEF)
[]
 regex.findall(ur\p{DummyProperty}, uabcDEF)
Traceback (most recent call last):
  File input, line 1, in module
  File regex.pyc, line 195, in findall
  File regex.pyc, line 563, in _compile
  File regex.pyc, line 642, in _parse_pattern
  File regex.pyc, line 654, in _parse_sequence
  File regex.pyc, line 662, in _parse_item
  File regex.pyc, line 787, in _parse_element
  File regex.pyc, line 1021, in _parse_escape
  File regex.pyc, line 1159, in _parse_property
error: undefined property name 'DummyProperty'
 

vbr

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2636
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2009-08-11 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Take a look a the dev FAQ, linked from http://www.python.org/dev.  The
tests are in Lib/test in a distribution installed from source, but
ideally you would be (anonymously) pulling the trunk from SVN (when it
is back) and creating your patches with respect to that code as
explained in the FAQ.  You would be adding unit test code to
Lib/test/test_re.py, though it looks like re_tests.py might be an
interesting file to look at as well.

As the dev docs say, anyone can contribute, and writing tests is a great
way to start, so please don't feel like you aren't qualified to
contribute, you are.  If you have questions, come to #python-dev on
freenode.

--
nosy: +r.david.murray

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2636
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6682] Default traceback does not handle PEP302 loaded modules

2009-08-11 Thread Anders Blomdell

New submission from Anders Blomdell anders.blomd...@control.lth.se:

While trying to get a PEP302 import hook to function properly, I found
that the default traceback picks up the wrong sourcecode for PEP302
loaded modules.

The testcase pep302_traceback.py tries to emulate the behavior of the
files in ordinary, which generates the following output when run:

  (cd ordinary ; python2.6.2 main.py )   

  A.__name__= a
  B.__name__ a.b
  Traceback (most recent call last):
File main.py, line 6, in module
  a.A()
  File /tmp/ordinary/a/__init__.py, line 6, in __init__
b.B()
  File /tmp/ordinary/a/b/__init__.py, line 4, in __init__
raise Exception()
  Exception

But when i run the testcase, I get the following:

  python2.6.2 pep302_traceback.py 
  ### Show possible bug in default linecache (works in 2.6.2)
  A.__name__= a
  B.__name__= a.b
  Traceback (most recent call last):
File pep302_traceback.py, line 82, in module
  i.load_module(__main__)
File pep302_traceback.py, line 58, in load_module
  exec(code, mod.__dict__)
File __main__.Importer/main.py, line 6, in module
  a.A()
File __main__.Importer/a/__init__.py, line 6, in __init__
  b.B()
File __main__.Importer/a/b/__init__.py, line 4, in __init__
  raise Exception()
  Exception
  ### Show possible bug in default traceback (does not work in 2.6.2)
  A.__name__= a
  B.__name__= a.b
  Traceback (most recent call last):
File pep302_traceback.py, line 88, in module
  i.load_module(__main__)
File pep302_traceback.py, line 58, in load_module
  exec(code, mod.__dict__)
File __main__.Importer/main.py, line 6, in module
  # main.py picked up from somewhere in sys.path
File __main__.Importer/a/__init__.py, line 6, in __init__
  # __init__.py picked up from somewhere in sys.path
File __main__.Importer/a/b/__init__.py, line 4, in __init__
  # __init__.py picked up from somewhere in sys.path
  Exception

I.e. in python 2.6 the linecache module correctly picks up PEP302 loaded
code, while the default traceback picks up any source file from sys.path
that happens to match the name of the file that generated the exception.
When run with python2.5.2, the linecache module also locates the wrong
file from sys.path.

--
components: Interpreter Core
files: bug.tar
messages: 91475
nosy: anders.blomd...@control.lth.se
severity: normal
status: open
title: Default traceback does not handle PEP302 loaded modules
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file14692/bug.tar

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6682
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6660] Desire python.org documentation link to user contribution wiki (per function)

2009-08-11 Thread kee nethery

kee nethery k...@kagi.com added the comment:

Is there anything I can do to help this happen? Am thinking that these  
are the steps to the process.

1. Create wiki.docs.python.org using the wiki setup template already  
used by wiki.python.org.
2. Lock page creation except for one specific account.
3. Create a template wiki page that has all the subsections desired  
(one per language version)
4. Grab all the existing docs for say version 2.5 moving forward, and  
at each perma-link, add a user contributions wiki link.
5. Keep track of all the user contribution wiki links
6. spin through the list of links and generate all the empty user  
contribution wiki pages.
7. release the docs with the new user contributions wiki links.

I'm not a wiki expert but I'd be happy to build the thing that creates  
each user contribution wiki link in the docs. Then I could pass the  
modified document files back to you. You could verify they are as  
desired. Once that looks good I could have code that spins through the  
links and creates the pages in the wiki.

Kee Nethery

 From: Georg Brandl rep...@bugs.python.org
 Date: August 6, 2009 3:38:33 PM PDT
 To: k...@kagi.com
 Subject: [issue6660] Desire python.org documentation link to user  
 contribution wiki (per function)
 Reply-To: Python tracker rep...@bugs.python.org


 Georg Brandl ge...@python.org added the comment:

 There will be comments for each function/class etc., as well as a
 feature to suggest a change for the proper text of a section.

 --

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue6660
 ___

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6660
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6681] email.parser clips trailing \n of multipart/mixed part if part ends in \r\n

2009-08-11 Thread Barry A. Warsaw

Barry A. Warsaw ba...@python.org added the comment:

Note that the headers in the subpart don't matter at all.  I'm sure this
is not a problem with MIME parsing, but with line ending issues.  It
might be related to mixing line endings, but we know that the email
package has some line ending problems.

--
nosy: +barry

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6681
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6683] smtplib authentication - try all mechanisms

2009-08-11 Thread Eric Shubert

New submission from Eric Shubert pyt...@shubes.net:

The login method in smtplib.py tries only one authentication mechanism.
There are legitimate situations where cram-md5 might fail, yet plain or
login would succeed.

RFC2554 states:
  If an AUTH command fails, the client may try another authentication
  mechanism by issuing another AUTH command.

The login method should attempt all mechanisms in preferred_auths before
returning a failure. This will make the code more robust, returning a
failure only when absolutely no authentication is possible.

--
messages: 91478
nosy: shubes
severity: normal
status: open
title: smtplib authentication - try all mechanisms
type: behavior
versions: Python 2.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6683
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6683] smtplib authentication - try all mechanisms

2009-08-11 Thread Gerhard Häring

Changes by Gerhard Häring g...@ghaering.de:


--
assignee:  - ghaering
nosy: +ghaering

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6683
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6684] x / 1 and x * 1 should return x

2009-08-11 Thread mrjbq7

New submission from mrjbq7 mrj...@users.sourceforge.net:

There are a couple arithmetic operations that idempotent, where the 
returned python object is the same python object as the input.  

For example, given a number:

 x = 12345

The abs() builtin returns the same number object if it is already a 
positive value:

 id(x)
17124964
 id(abs(x))
17124964

The multiply by zero operation returns a single zero object:

 id(x * 0)
16794004
 id(x * 0)
16794004

But, the multiply by 1 or divide by 1 does not:

 id(x * 1)
17124928
 id(x * 1)
17124880
 id(x / 1)
17203652
 id(x / 1)
17124952

--
messages: 91479
nosy: mrjbq7
severity: normal
status: open
title: x / 1 and x * 1 should return x

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6684
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6684] x / 1 and x * 1 should return x

2009-08-11 Thread mrjbq7

Changes by mrjbq7 mrj...@users.sourceforge.net:


--
components: +Interpreter Core
versions: +Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6684
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6684] x / 1 and x * 1 should return x

2009-08-11 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

Sorry, Python makes no guarantees about object identity for numbers, so
this is just an optimization request.  While it could save a little
space (one number object) and a little time (for allocating that
object), the special casing imposes a small (but non-zero) cost on every
other case for multiplication and division -- optimizing one corner case
at the expense of the general case.

* practicality beat purity
* special cases are not special enough ...

--
assignee:  - rhettinger
nosy: +rhettinger
resolution:  - invalid
status: open - closed
type:  - performance

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6684
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6685] CGI module documentation references method 'toupper'; should be 'upper'

2009-08-11 Thread Troy J. Farrell

New submission from Troy J. Farrell t...@entheossoft.com:

The cgi module references a method 'toupper' on strings which should
really reference 'upper'.  The line is around 211 of cgi.txt, depending
on the version of the documentation.  Search for `toupper`, (include
the backticks.)

--
assignee: georg.brandl
components: Documentation
messages: 91481
nosy: georg.brandl, troy
severity: normal
status: open
title: CGI module documentation references method 'toupper'; should be 'upper'
type: feature request
versions: Python 2.6, Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6685
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6643] joining a child that forks can deadlock in the forked child process

2009-08-11 Thread Collin Winter

Changes by Collin Winter coll...@gmail.com:


--
components: +Interpreter Core
nosy: +collinwinter, jyasskin

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6643
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6680] Python 3.1 fails to build when db.h contains non-UTF-8 characters

2009-08-11 Thread Brett Cannon

Changes by Brett Cannon br...@python.org:


--
stage:  - patch review

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6680
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6686] xml.sax.xmlreader.XMLReader.getProperty (xml.sax.handler.property_xml_string) returns bytes

2009-08-11 Thread Colin Stewart

New submission from Colin Stewart co...@owlfish.com:

The documentation for the xml.sax.handler.property_xml_string SAX
property states that it should be data type: String.  However when
retrieving this value in Python 3.1 it returns a bytes object instead.

This makes handling the returned value very difficult because there is
no method for retrieving the character set encoding that the XML was
originally encoded with.

This is currently blocking the port of SimpleTAL to Python 3 achieving
feature parity with Python 2.

--
components: XML
messages: 91482
nosy: cms103
severity: normal
status: open
title: xml.sax.xmlreader.XMLReader.getProperty 
(xml.sax.handler.property_xml_string) returns bytes
type: behavior
versions: Python 3.1

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6686
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6687] Move the special-case for integer objects out of PyBytes_FromObject.

2009-08-11 Thread Alexandre Vassalotti

New submission from Alexandre Vassalotti alexan...@peadrop.com:

The documentation for PyBytes_FromObject states:

.. cfunction:: PyObject* PyBytes_FromObject(PyObject *o)

   Return the bytes representation of object *o* that implements
   the buffer protocol.

However, there exists a special-case for integer object in
PyBytes_FromObject that makes the function return a null-initialized
bytes object. Currently, this is only used for handling `bytes(10)'.

I don't like changing APIs after a stable release, but I believe this
behaviour is error-prone and surprising (and darn right annoying even).
So, I believe the special-case should be made specific to the bytes
constructor.

Thus, here is the fine patch.

--
components: Interpreter Core
files: move_int_special_case.diff
keywords: 26backport, patch
messages: 91483
nosy: alexandre.vassalotti
priority: normal
severity: normal
stage: patch review
status: open
title: Move the special-case for integer objects out of PyBytes_FromObject.
type: behavior
versions: Python 3.2
Added file: http://bugs.python.org/file14693/move_int_special_case.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6687
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6687] Move the special-case for integer objects out of PyBytes_FromObject.

2009-08-11 Thread Alexandre Vassalotti

Alexandre Vassalotti alexan...@peadrop.com added the comment:

Oh, in case you wonder, the added PyUnicode_Check(x) check is to force
PyBytes_FromObject to raise an error when given an empty unicode string
(I will this as a comment in my patch).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6687
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6687] Move the special-case for integer objects out of PyBytes_FromObject.

2009-08-11 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

+1

--
nosy: +benjamin.peterson

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6687
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6688] Optimize PyBytes_FromObject.

2009-08-11 Thread Alexandre Vassalotti

New submission from Alexandre Vassalotti alexan...@peadrop.com:

Optimize PyBytes_FromObject by adding special-cases for list and tuple
objects and by using _PyObject_LengthHint() instead of an arbitrary
value for the size of the initial buffer.

[Without the patch]
./python -m timeit -s x = list(range(256)) bytes(x)
10 loops, best of 3: 7.19 usec per loop

./python -m timeit -s x = tuple(range(256)) bytes(x)
10 loops, best of 3: 7.14 usec per loop

./python -m timeit -s x = list(range(256))*100 bytes(x)
1000 loops, best of 3: 591 usec per loop

./python -m timeit -s x = range(256) bytes(x)
10 loops, best of 3: 8.45 usec per loop


[With the patch]

./python -m timeit -s x = list(range(256)) bytes(x)
10 loops, best of 3: 4.43 usec per loop

./python -m timeit -s x = tuple(range(256)) bytes(x)
10 loops, best of 3: 4.53 usec per loop

./python -m timeit -s x = list(range(256))*100 bytes(x)
1000 loops, best of 3: 335 usec per loop

./python -m timeit -s x = range(256) bytes(x)
10 loops, best of 3: 7.56 usec per loop

--
components: Interpreter Core
files: optimize_bytes_from_object.diff
keywords: patch
messages: 91486
nosy: alexandre.vassalotti
priority: normal
severity: normal
stage: patch review
status: open
title: Optimize PyBytes_FromObject.
type: performance
Added file: http://bugs.python.org/file14694/optimize_bytes_from_object.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6688
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1023290] proposed struct module format code addition

2009-08-11 Thread Alexandre Vassalotti

Alexandre Vassalotti alexan...@peadrop.com added the comment:

I went ahead and coded a new API for converting long integers to byte
arrays and vice-versa. My patch adds two new methods to the long type:
.as_bytes() and .frombytes(). The patch itself is well-documented; but
nevertheless, here's some examples: 

 (1024).as_bytes()
b'\x04\x00'
 (1024).as_bytes(fixed_length=10)
b'\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00'
 (-1024).as_bytes(fixed_length=10)
b'\xff\xff\xff\xff\xff\xff\xff\xff\xfc\x00'
 (-1024).as_bytes(little_endian=True)
b'\x00\xfc'
 ((2**16)-1).as_bytes(fixed_length=2, signed=False)
b'\xff\xff'

 int.frombytes(b'\x00\x10')
16
 int.frombytes(b'\x00\x10', little_endian=True)
4096
 int.frombytes(b'\xfc\x00')
-1024
 int.frombytes(b'\xfc\x00', signed=False)
64512


This patch depends on another patch posted in issue #6687. So, apply the
other patch before testing this one.

--
nosy: +alexandre.vassalotti
Added file: http://bugs.python.org/file14695/long_and_bytes_conversion.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1023290
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6673] Py3.1 hangs in coroutine and eats up all memory

2009-08-11 Thread Alexandre Vassalotti

Alexandre Vassalotti alexan...@peadrop.com added the comment:

Not a bug.

The list comprehension in your chunker:

while True:
target.send([ (yield) for i in range(chunk_size) ])

is equivalent to the following generator in Python 3:

while True:
def g():
for i in range(chunk_size):
yield (yield)
target.send(list(g()))

This clearly needs not what you want. So, just rewrite your code using
for-loop:

while True:
result = []
for i in range(chunk_size):
result.append((yield))
target.send(result)

--
nosy: +alexandre.vassalotti
resolution:  - invalid
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6673
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6626] show Python mimetypes module some love

2009-08-11 Thread Jacob Rus

Jacob Rus jacobo...@gmail.com added the comment:

Plone uses this thing, which has *much* more complexity than necessary for 
the standard library, but it might be nice to pick up the code for pulling 
types out of the windows registry, for instance.

http://svn.plone.org/svn/archetypes/Products.MimetypesRegistry/trunk/Produ
cts/MimetypesRegistry/MimeTypesRegistry.py

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6626
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2009-08-11 Thread John Machin

John Machin sjmac...@users.sourceforge.net added the comment:

What is the expected timing comparison with re? Running the Aug10#3
version on Win XP SP3 with Python 2.6.3, I see regex typically running
at only 20% to %50 of the speed of re in ASCII mode, with
not-very-atypical tests (find all Python identifiers in a line, failing
search for a Python identifier in an 80-byte text). Is the supplied
_regex.pyd from some sort of debug or unoptimised build? Here are some
results:

dos-prompt\python26\python -mtimeit -simport re as
x;r=x.compile(r'[A-Za-z_][A-Za-z0-9_]+');t='def __init__(self, arg1,
arg2):\n' r.findall(t)
10 loops, best of 3: 5.32 usec per loop

dos-prompt\python26\python -mtimeit -simport regex as
x;r=x.compile(r'[A-Za-z_][A-Za-z0-9_]+');t='def __init__(self, arg1,
arg2):\n' r.findall(t)
10 loops, best of 3: 12.2 usec per loop

dos-prompt\python26\python -mtimeit -simport re as
x;r=x.compile(r'[A-Za-z_][A-Za-z0-9_]+');t='1234567890'*8 r.search(t)
100 loops, best of 3: 1.61 usec per loop

dos-prompt\python26\python -mtimeit -simport regex as
x;r=x.compile(r'[A-Za-z_][A-Za-z0-9_]+');t='1234567890'*8 r.search(t)
10 loops, best of 3: 7.62 usec per loop

Here's the worst case that I've found so far:

dos-prompt\python26\python -mtimeit -simport re as
x;r=x.compile(r'z{80}');t='z'*79 r.search(t)
100 loops, best of 3: 1.19 usec per loop

dos-prompt\python26\python -mtimeit -simport regex as
x;r=x.compile(r'z{80}');t='z'*79 r.search(t)
1000 loops, best of 3: 334 usec per loop

See Friedl: length cognizance. Corresponding figures for match() are
1.11 and 8.5.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2636
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6626] show Python mimetypes module some love

2009-08-11 Thread Jacob Rus

Changes by Jacob Rus jacobo...@gmail.com:


Removed file: http://bugs.python.org/file14632/mimetypes4.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6626
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6626] show Python mimetypes module some love

2009-08-11 Thread Jacob Rus

Changes by Jacob Rus jacobo...@gmail.com:


Added file: http://bugs.python.org/file14696/mimetypes4.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6626
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com