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

Allow rb"" literals as an equivalent to br"" #57957

Closed
pitrou opened this issue Jan 9, 2012 · 8 comments
Closed

Allow rb"" literals as an equivalent to br"" #57957

pitrou opened this issue Jan 9, 2012 · 8 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement

Comments

@pitrou
Copy link
Member

pitrou commented Jan 9, 2012

BPO 13748
Nosy @gvanrossum, @warsaw, @birkenfeld, @ncoghlan, @pitrou, @benjaminp
Files
  • rb.patch
  • rb2.patch
  • 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 2012-01-12.21:48:47.512>
    created_at = <Date 2012-01-09.19:14:10.269>
    labels = ['interpreter-core', 'type-feature']
    title = 'Allow rb"" literals as an equivalent to br""'
    updated_at = <Date 2012-01-12.21:48:47.511>
    user = 'https://github.com/pitrou'

    bugs.python.org fields:

    activity = <Date 2012-01-12.21:48:47.511>
    actor = 'pitrou'
    assignee = 'none'
    closed = True
    closed_date = <Date 2012-01-12.21:48:47.512>
    closer = 'pitrou'
    components = ['Interpreter Core']
    creation = <Date 2012-01-09.19:14:10.269>
    creator = 'pitrou'
    dependencies = []
    files = ['24188', '24189']
    hgrepos = []
    issue_num = 13748
    keywords = ['patch']
    message_count = 8.0
    messages = ['150964', '150967', '150974', '150978', '150979', '151038', '151153', '151154']
    nosy_count = 7.0
    nosy_names = ['gvanrossum', 'barry', 'georg.brandl', 'ncoghlan', 'pitrou', 'benjamin.peterson', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'commit review'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue13748'
    versions = ['Python 3.3']

    @pitrou
    Copy link
    Member Author

    pitrou commented Jan 9, 2012

    As mentioned in bpo-13744, it is not easy to remember that br"" is an allowed bytes literal but not rb"". Here is a patch to allow both forms.

    @pitrou pitrou added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement labels Jan 9, 2012
    @pitrou
    Copy link
    Member Author

    pitrou commented Jan 9, 2012

    Updated patch with doc.

    @warsaw
    Copy link
    Member

    warsaw commented Jan 9, 2012

    On Jan 09, 2012, at 07:27 PM, Antoine Pitrou wrote:

    Updated patch with doc.

    Nicely done. +1

    @benjaminp
    Copy link
    Contributor

    I would be happier if there was precedent for this with "ur" = "ru" in 2.x, which is not true.

    @pitrou
    Copy link
    Member Author

    pitrou commented Jan 9, 2012

    I would be happier if there was precedent for this with "ur" = "ru" in
    2.x, which is not true.

    In my experience, raw unicode literals were very rare while raw bytes
    literals are quite frequent (mainly for regular expressions).

    @birkenfeld
    Copy link
    Member

    +1 for "raw bytes", which reads much nicer to me than "bytes raw".

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jan 12, 2012

    New changeset bbed36370b08 by Antoine Pitrou in branch 'default':
    Issue bpo-13748: Raw bytes literals can now be written with the rb prefix as well as br.
    http://hg.python.org/cpython/rev/bbed36370b08

    @pitrou
    Copy link
    Member Author

    pitrou commented Jan 12, 2012

    Committed, thanks.

    @pitrou pitrou closed this as completed Jan 12, 2012
    @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
    interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants