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

Eliminate Perl legacy in re flag names #47100

Closed
mark-summerfield mannequin opened this issue May 14, 2008 · 2 comments
Closed

Eliminate Perl legacy in re flag names #47100

mark-summerfield mannequin opened this issue May 14, 2008 · 2 comments
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@mark-summerfield
Copy link
Mannequin

mark-summerfield mannequin commented May 14, 2008

BPO 2851
Nosy @gvanrossum, @mark-summerfield

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 2008-05-14.15:09:10.788>
created_at = <Date 2008-05-14.12:40:47.409>
labels = ['type-feature', 'library']
title = 'Eliminate Perl legacy in re flag names'
updated_at = <Date 2008-05-14.15:09:09.357>
user = 'https://github.com/mark-summerfield'

bugs.python.org fields:

activity = <Date 2008-05-14.15:09:09.357>
actor = 'gvanrossum'
assignee = 'none'
closed = True
closed_date = <Date 2008-05-14.15:09:10.788>
closer = 'gvanrossum'
components = ['Library (Lib)']
creation = <Date 2008-05-14.12:40:47.409>
creator = 'mark'
dependencies = []
files = []
hgrepos = []
issue_num = 2851
keywords = []
message_count = 2.0
messages = ['66817', '66819']
nosy_count = 2.0
nosy_names = ['gvanrossum', 'mark']
pr_nums = []
priority = 'normal'
resolution = 'wont fix'
stage = None
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue2851'
versions = ['Python 3.0']

@mark-summerfield
Copy link
Mannequin Author

mark-summerfield mannequin commented May 14, 2008

The re module has the following flags (amongst others):

re.X == re.VERBOSE
re.S == re.DOTALL

The short forms of both these flags are clearly taken from Perl, but
they don't seem necessary for Python and are confusing since all the
other short names start with the same letter as the long name, e.g.,
re.I == re.IGNORECASE and re.M == re.MULTILINE.

Why not add re.V for re.VERBOSE and re.D for re.DOTALL and kill re.X and
re.S and say a final farewell to Perl?

@mark-summerfield mark-summerfield mannequin added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels May 14, 2008
@gvanrossum
Copy link
Member

Please keep them. They correspond to the (?x) and (?s) syntax that is
supported inside the regex.

Perl compatibility is a feature, not a bug for the re module.

@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
stdlib Python modules in the Lib dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant