Skip to content

Fix typo error and calculated value - #2

Open
diegomvh wants to merge 8 commits into
mitsuhiko:masterfrom
diegomvh:master
Open

Fix typo error and calculated value#2
diegomvh wants to merge 8 commits into
mitsuhiko:masterfrom
diegomvh:master

Conversation

@diegomvh

@diegomvh diegomvh commented Feb 9, 2012

Copy link
Copy Markdown

Hi,
We using ponyguruma for a project hosted here in github.
The errors commited in this request was solved in the d3f0's repository of your project.
This commit fix two errors in _highlevel.py file:

First error:

import ponyguruma
pattern = ponyguruma.Regexp("\s+")
pattern.split("Hello World")


NameError Traceback (most recent call last)
/mnt/datos/workspace/GitHub/ponyguruma/build/lib.linux-i686-2.7/ in ()
----> 1 pattern.split("Hello World")

/mnt/datos/workspace/GitHub/ponyguruma/build/lib.linux-i686-2.7/ponyguruma/_highlevel.py in split(self, string, maxsplit, pos, endpos, flat)
179 startstring = string[:pos]
180 n = 0
--> 181 push_match = (flag and result.append or result.extend)
182 while 1:
183 state = regexp_match(self, string, pos, endpos, False)

NameError: global name 'flag' is not defined

Second error:

from ponyguruma import sre
pattern = sre.compile("(\w+)")
match = pattern.match("Hello World")
type(match.groups)
instancemethod
match.groups
<bound method SRE_Match.groups of <ponygurma.sre.SRE_Match object at 0x860ea6c>>
match.groups()
('Hello',)

match.groups()

TypeError Traceback (most recent call last)
/mnt/datos/workspace/GitHub/ponyguruma/build/lib.linux-i686-2.7/ in ()
----> 1 match.groups()
match.groups
('Hello',)
type(match.groups)
tuple

@jayvdb jayvdb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good changes, especially the Python 3 support

@jayvdb

jayvdb commented Jul 24, 2019

Copy link
Copy Markdown

If you want to retain Python 2 support, that should be fairly easy to do.

@jayvdb

jayvdb commented Jul 24, 2019

Copy link
Copy Markdown

I see https://github.com/prymatex/ponyguruma has this.

But nobody is claiming and publishing to

https://pypi.org/project/ponyguruma/

;-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants