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

repr doesn't give full result for this re math result #73260

Closed
redstone-cold mannequin opened this issue Dec 26, 2016 · 5 comments
Closed

repr doesn't give full result for this re math result #73260

redstone-cold mannequin opened this issue Dec 26, 2016 · 5 comments
Labels
topic-regex type-bug An unexpected behavior, bug, or error

Comments

@redstone-cold
Copy link
Mannequin

redstone-cold mannequin commented Dec 26, 2016

BPO 29074
Nosy @ezio-melotti, @bitdancer

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2016-12-26.15:43:14.272>
created_at = <Date 2016-12-26.12:41:55.008>
labels = ['expert-regex', 'type-bug', 'invalid']
title = "repr doesn't give full result for this re math result"
updated_at = <Date 2016-12-28.16:23:03.225>
user = 'https://bugs.python.org/redstone-cold'

bugs.python.org fields:

activity = <Date 2016-12-28.16:23:03.225>
actor = 'mrabarnett'
assignee = 'none'
closed = True
closed_date = <Date 2016-12-26.15:43:14.272>
closer = 'mrabarnett'
components = ['Regular Expressions']
creation = <Date 2016-12-26.12:41:55.008>
creator = 'redstone-cold'
dependencies = []
files = []
hgrepos = []
issue_num = 29074
keywords = []
message_count = 5.0
messages = ['284024', '284032', '284033', '284058', '284181']
nosy_count = 5.0
nosy_names = ['ezio.melotti', 'mrabarnett', 'r.david.murray', 'iMath', 'redstone-cold']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue29074'
versions = ['Python 3.5']

@redstone-cold
Copy link
Mannequin Author

redstone-cold mannequin commented Dec 26, 2016

I tested with Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)] on win32

re.search(r'http://v.pptv.com/show/.*?\.html.+', 'http://v.pptv.com/show/2bwkox9SS4nsatI.html?rcc_src=P5') 
does give a match, but it show the result 
<_sre.SRE_Match object; span=(0, 54), match='http://v.pptv.com/show/2bwkox9SS4nsatI.html?rcc_s>
missing rc=P5' in IDLE

BTW, py2.7 works fine

@redstone-cold redstone-cold mannequin added topic-regex type-bug An unexpected behavior, bug, or error labels Dec 26, 2016
@mrabarnett
Copy link
Mannequin

mrabarnett mannequin commented Dec 26, 2016

See bpo-17087: "Improve the repr for regular expression match objects".

It was decided that it might be a bad idea to show the entire matched portion of the string because it could be very long, so it's shown truncated if necessary.

@mrabarnett mrabarnett mannequin closed this as completed Dec 26, 2016
@mrabarnett mrabarnett mannequin added the invalid label Dec 26, 2016
@bitdancer
Copy link
Member

If it is truncated, should it end with '...' or [...]?

@iMath
Copy link
Mannequin

iMath mannequin commented Dec 27, 2016

I think so, the current behavior is misleading

在2016年12月27 00时08分, "R. David Murray"<report@bugs.python.org>写道:

R. David Murray added the comment:

If it is truncated, should it end with '...' or [...]?

----------
nosy: +r.david.murray


Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue29074\>


@mrabarnett
Copy link
Mannequin

mrabarnett mannequin commented Dec 28, 2016

Probably "...", although we also have to consider that the matched portion could in fact not be truncated but just happen to end with "...", although that would be a rare occurrence.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-regex type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant