Skip to content

reprlib.Repr.__init__ should accept arguments #85167

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

Closed
remilapeyre mannequin opened this issue Jun 16, 2020 · 3 comments
Closed

reprlib.Repr.__init__ should accept arguments #85167

remilapeyre mannequin opened this issue Jun 16, 2020 · 3 comments
Labels
3.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@remilapeyre
Copy link
Mannequin

remilapeyre mannequin commented Jun 16, 2020

BPO 40995
Nosy @remilapeyre
PRs
  • bpo-40995: reprlib.Repr attributes can be overriden in __init__() #20925
  • 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 = None
    created_at = <Date 2020-06-16.23:00:12.260>
    labels = ['type-bug', 'library', '3.10']
    title = 'reprlib.Repr.__init__ should accept arguments'
    updated_at = <Date 2020-06-16.23:13:25.734>
    user = 'https://github.com/remilapeyre'

    bugs.python.org fields:

    activity = <Date 2020-06-16.23:13:25.734>
    actor = 'remi.lapeyre'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2020-06-16.23:00:12.260>
    creator = 'remi.lapeyre'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 40995
    keywords = ['patch']
    message_count = 1.0
    messages = ['371701']
    nosy_count = 1.0
    nosy_names = ['remi.lapeyre']
    pr_nums = ['20925']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue40995'
    versions = ['Python 3.10']

    @remilapeyre
    Copy link
    Mannequin Author

    remilapeyre mannequin commented Jun 16, 2020

    reprlib.Repr does not accept arguments for the moment so setting its attributes must be done in multiple steps:

    import reprlib
    r = reprlib.Repr()
    r.maxstring = 10
    r.maxset = 4
    r.repr(...)

    It would be more user-friendly to be able to do:

    import reprlib
    r = reprlib.Repr(maxstring=10, maxset=4)
    r.repr(...)

    @remilapeyre remilapeyre mannequin added 3.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Jun 16, 2020
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @gvanrossum
    Copy link
    Member

    Looks like this was implemented by #94343.

    @gvanrossum
    Copy link
    Member

    (I meant #94581.)

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant