Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0. Introduction.md Problems #5

Open
suciokhan opened this issue Feb 15, 2024 · 1 comment
Open

0. Introduction.md Problems #5

suciokhan opened this issue Feb 15, 2024 · 1 comment

Comments

@suciokhan
Copy link

suciokhan commented Feb 15, 2024

Describe the bug
In the second code cell of this sheet (https://github.com/rlayers/pawpaw/blob/master/docs/0.%20Introduction.md) the code returns an attribute error:

'TypeError: fullmatch() missing 2 required positional arguments: 'pattern' and 'string'

To Reproduce
Execute:

import regex 
re = regex.compile(r'(?:(?P<phrase>(?P<word>(?P<char>\w)+) (?P<number>(?P<digit>\d)+))\s*)+')
m = regex.fullmatch()

Expected behavior
Regex match performed.

It can be fixed by changing to:

m = regex.fullmatch(re, s)

Unfortunately...the 4th section also fails once this correction is implemented...

Running this:

import pawpaw
root = pawpaw.Ito.from_match(m)
print(*root.find_all('**[d:digit]'), sep=', ')  # print all digits

Will result in this:
AttributeError: 'list' object has no attribute 'find_all'

I haven't gotten further in running this introduction- can you please review it for any additional issues?

Additional Context
Using Python 3.10.12
Using regex 2.5.140

@suciokhan suciokhan changed the title 0. Introduction.md Problem 0. Introduction.md Problems Feb 15, 2024
@rlayers
Copy link
Owner

rlayers commented May 14, 2024 via email

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

No branches or pull requests

2 participants