Created
August 15, 2011 13:58
-
-
Save jedie/1146809 to your computer and use it in GitHub Desktop.
re diff: pypy <-> ypython
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
link = re.compile( | |
r'''(?P<link> | |
\[\[ | |
(?P<link_target>.+?) \s* | |
([|] \s* (?P<link_text>.+?) \s*)? | |
]] | |
)''', re.VERBOSE | re.UNICODE | |
) | |
def test(match): | |
print match.groupdict() | |
link.sub(test, "1 [[internal links|link text]] test.") | |
# PyPy (pypy-c-jit-43780-b590cf6de419-linux64) output: | |
{'link_target': 'internal links|link text', 'link': '[[internal links|link text]]', 'link_text': None} | |
# CPython output: | |
{'link_target': 'internal links', 'link': '[[internal links|link text]]', 'link_text': 'link text'} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
fixes in PyPy nightly build ;)