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

PyArg_ParseTuple(): remove old and unused "O?" format #53083

Closed
vstinner opened this issue May 27, 2010 · 2 comments
Closed

PyArg_ParseTuple(): remove old and unused "O?" format #53083

vstinner opened this issue May 27, 2010 · 2 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@vstinner
Copy link
Member

BPO 8837
Nosy @mdickinson, @vstinner
Files
  • getarg_oquestion.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 2010-05-28.21:55:57.842>
    created_at = <Date 2010-05-27.22:59:39.615>
    labels = ['interpreter-core']
    title = 'PyArg_ParseTuple(): remove old and unused "O?" format'
    updated_at = <Date 2010-05-28.21:55:57.840>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2010-05-28.21:55:57.840>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2010-05-28.21:55:57.842>
    closer = 'vstinner'
    components = ['Interpreter Core']
    creation = <Date 2010-05-27.22:59:39.615>
    creator = 'vstinner'
    dependencies = []
    files = ['17478']
    hgrepos = []
    issue_num = 8837
    keywords = ['patch']
    message_count = 2.0
    messages = ['106624', '106692']
    nosy_count = 2.0
    nosy_names = ['mark.dickinson', 'vstinner']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue8837'
    versions = ['Python 3.2']

    @vstinner
    Copy link
    Member Author

    "O?" format was introduced by r4301 (15 years, 9 months ago). PyArg_ParseTuple() was first documented in Python 2.2, but without the full list of all formats. The format list was added to Python 2.3, but "O?" was never documented. So I get that no third party progam use it.

    In Python trunk, "O?" is no more used and so I propose to remove it to simplify getarg.c (simplify getarg cannot be a bad thing). PyArg_ParseTuple() has now better formats than "O?".

    --

    "O&" calls a callback: if the callback returns 0, raise an error; otherwise gets the object. Example of callbacks: PyXXX_Check() function (eg. PyInt_Check()).

    --

    The full Python test suite pass without any error on a patched Python (trunk).

    @vstinner vstinner added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label May 27, 2010
    @vstinner
    Copy link
    Member Author

    Commited: r81588 (py3k), blocked in 3.1 (r81589).

    @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)
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant