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

sre_compile._optimize_unicode() needs a cleanup #57309

Closed
vstinner opened this issue Oct 4, 2011 · 3 comments
Closed

sre_compile._optimize_unicode() needs a cleanup #57309

vstinner opened this issue Oct 4, 2011 · 3 comments
Labels
stdlib Python modules in the Lib dir topic-regex topic-unicode type-bug An unexpected behavior, bug, or error

Comments

@vstinner
Copy link
Member

vstinner commented Oct 4, 2011

BPO 13100
Nosy @pitrou, @vstinner, @ezio-melotti, @serhiy-storchaka

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 2013-01-03.02:02:38.441>
created_at = <Date 2011-10-04.17:11:58.221>
labels = ['expert-regex', 'type-bug', 'library', 'expert-unicode']
title = 'sre_compile._optimize_unicode() needs a cleanup'
updated_at = <Date 2013-10-21.11:46:00.617>
user = 'https://github.com/vstinner'

bugs.python.org fields:

activity = <Date 2013-10-21.11:46:00.617>
actor = 'serhiy.storchaka'
assignee = 'none'
closed = True
closed_date = <Date 2013-01-03.02:02:38.441>
closer = 'vstinner'
components = ['Library (Lib)', 'Regular Expressions', 'Unicode']
creation = <Date 2011-10-04.17:11:58.221>
creator = 'vstinner'
dependencies = []
files = []
hgrepos = []
issue_num = 13100
keywords = []
message_count = 3.0
messages = ['144905', '178896', '200753']
nosy_count = 5.0
nosy_names = ['pitrou', 'vstinner', 'ezio.melotti', 'mrabarnett', 'serhiy.storchaka']
pr_nums = []
priority = 'normal'
resolution = 'wont fix'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue13100'
versions = ['Python 3.3']

@vstinner
Copy link
Member Author

vstinner commented Oct 4, 2011

The following comment is wrong,

    except IndexError:
        # non-BMP characters; XXX now they should work
        return charset

sys.maxunicode != 65535 is now always true in Python 3.3

        if sys.maxunicode != 65535:
            # XXX: negation does not work with big charsets
            # XXX2: now they should work, but removing this will make the
            # charmap 17 times bigger
            return charset

See the related commit: f39b26ca7f3d (from issue bpo-13054).

@vstinner vstinner added stdlib Python modules in the Lib dir topic-regex topic-unicode labels Oct 4, 2011
@vstinner
Copy link
Member Author

vstinner commented Jan 3, 2013

I don't know what to do with this issue. The code looks to work anyway, so I guess that it's safer to not touch it :-)

@vstinner vstinner closed this as completed Jan 3, 2013
@ezio-melotti ezio-melotti added the type-bug An unexpected behavior, bug, or error label Jan 3, 2013
@serhiy-storchaka
Copy link
Member

There are a lot of dead or suboptimal code in the re module. For example _sre.CODESIZE now can't be 2. We could cleanup the code as side effect of optimization.

@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 topic-regex topic-unicode type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants