GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Using new 'bool' format character · Issue #60203 · python/cpython

Using new 'bool' format character #60203

New issue
Copy link
New issue
Copy link
Closed
Closed
Using new 'bool' format character#60203
Copy link
Assignees
gpsheadserhiy-storchaka
Labels
3.12only security fixesonly security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement

Description

@serhiy-storchaka
serhiy-storchaka
opened on Sep 21, 2012
Issue body actions
BPO 15999
Nosy @larryhastings, @Rosuav, @serhiy-storchaka
PRs
  • bpo-15999: Accept arbitrary values for boolean parameters. #15609
  • bpo-15999: Clean up of handling boolean arguments. #15610
  • bpo-15999: Always pass bool instead of int to socket.setblocking(). #15621
  • bpo-15999: Always pass bool instead of int to the expat parser. #15622
  • Files
  • use_bool_parsing.diff
  • bool_cleanup.patch
  • accept_bool.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 = 'https://github.com/serhiy-storchaka'
    closed_at = None
    created_at = <Date 2012-09-21.15:47:09.273>
    labels = ['extension-modules', 'interpreter-core', 'type-feature']
    title = "Using new 'bool' format character"
    updated_at = <Date 2019-09-01.09:16:53.793>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2019-09-01.09:16:53.793>
    actor = 'serhiy.storchaka'
    assignee = 'serhiy.storchaka'
    closed = False
    closed_date = None
    closer = None
    components = ['Extension Modules', 'Interpreter Core']
    creation = <Date 2012-09-21.15:47:09.273>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = ['27244', '40809', '40810']
    hgrepos = []
    issue_num = 15999
    keywords = ['patch']
    message_count = 7.0
    messages = ['170897', '170898', '252765', '253154', '350940', '350941', '350942']
    nosy_count = 3.0
    nosy_names = ['larry', 'Rosuav', 'serhiy.storchaka']
    pr_nums = ['15609', '15610', '15621', '15622']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue15999'
    versions = ['Python 3.4']

    Linked PRs

    • gh-60203: Revert changes in cycle.__setstate__ #99982
    • gh-60203: Always pass True/False as boolean arguments in tests #99983
    • [3.11] gh-60203: Always pass True/False as boolean arguments in tests (GH-99983) #99986
    • [3.10] gh-60203: Always pass True/False as boolean arguments in tests… #99989
    • [3.11] gh-60203: Revert changes in cycle.__setstate__ (GH-99982) #100016
    • [3.10] gh-60203: Revert changes in cycle.__setstate__ (GH-99982) #100017

    Activity

    Next
    1. serhiy-storchaka commented on Sep 21, 2012

      @serhiy-storchaka
      serhiy-storchaka
      on Sep 21, 2012
      MemberAuthor
      More actions

      bpo-14705 added 'bool' format character to PyArg_ParseTuple for using it for parsing multiple boolean arguments in os module. The proposed patch uses this format character for other boolean arguments. This makes the sources simpler, clearer and more reliable, improves error messages, gets rid of a few rare errors.

    2. serhiy-storchaka
      added
      extension-modulesC modules in the Modules dirC modules in the Modules dir
      interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
      type-featureA feature request or enhancementA feature request or enhancement
      on Sep 21, 2012
    3. larryhastings commented on Sep 21, 2012

      @larryhastings
      larryhastings
      on Sep 21, 2012
      Contributor
      More actions

      Patch looks fine in principle, though I'd want someone to go over the individual cases to make sure they make sense.

      Also, I have something up my sleeve regarding argument parsing for 3.4, and if it gets accepted we might be touching all this code anyway. I mention this just to say--you may want to hold off on more patches like this for now.

    4. serhiy-storchaka
      self-assigned this
      on Dec 29, 2012
    5. Rosuav commented on Oct 11, 2015

      @Rosuav
      Rosuav
      on Oct 11, 2015
      Contributor
      More actions

      Has this been entirely superseded by Argument Clinic?

    6. serhiy-storchaka commented on Oct 18, 2015

      @serhiy-storchaka
      serhiy-storchaka
      on Oct 18, 2015
      MemberAuthor
      More actions

      No, it is orthogonal to Argument Clinic. Usually converting to Argument Clinic didn't change semantic. However these changes conflicted with proposed patch.

      Rebased patch is splitted on two patches.

      bool_cleanup.patch. It almost doesn't change the behavior. It uses the "p" format unit instead of manually called PyObject_IsTrue(), passes boolean value instead 0/1 integers to functions that needs boolean, and made some arguments ("flush" in print(), "strict", "sort_keys" and "skipkeys" in json module) to be converted to boolean only once.

      accept_bool.patch. It makes a number of functions to accept arbitrary objects in boolean context, not just False/True and ints representable as C int. But I prefer first to commit the patch for bpo-24037.

    7. serhiy-storchaka commented on Sep 1, 2019

      @serhiy-storchaka
      serhiy-storchaka
      on Sep 1, 2019
      MemberAuthor
      More actions

      New changeset eb89746 by Serhiy Storchaka in branch 'master':
      bpo-15999: Always pass bool instead of int to the expat parser. (GH-15622)
      eb89746

    8. serhiy-storchaka commented on Sep 1, 2019

      @serhiy-storchaka
      serhiy-storchaka
      on Sep 1, 2019
      MemberAuthor
      More actions

      New changeset 5eca7f3 by Serhiy Storchaka in branch 'master':
      bpo-15999: Always pass bool instead of int to socket.setblocking(). (GH-15621)
      5eca7f3

    9. serhiy-storchaka commented on Sep 1, 2019

      @serhiy-storchaka
      serhiy-storchaka
      on Sep 1, 2019
      MemberAuthor
      More actions

      New changeset 1f21eaa by Serhiy Storchaka in branch 'master':
      bpo-15999: Clean up of handling boolean arguments. (GH-15610)
      1f21eaa

    10. ezio-melotti
      transferred this issue fromon Apr 10, 2022
    11. gpshead commented on Dec 3, 2022

      @gpshead
      gpshead
      on Dec 3, 2022
      Member
      More actions

      #15609 was merged.

      I didn't try to figure out if there were any more of these left, that PR from @serhiy-storchaka took care of a large number of them.

    12. gpshead commented on Dec 3, 2022

      @gpshead
      gpshead
      on Dec 3, 2022
      Member
      More actions

      I'll close this issue as the end point isn't well defined with something we can easily check "[x] Complete" on.

      But it could be considered ongoing work to clean up any remaining. Feel free to re-open if anyone has identified more.

      Or just file new more specific issues for each area of the codebase still being overly pedantic about bool in C code.

    13. gpshead
      closed this as completedon Dec 3, 2022
    14. 4 remaining items

    15. serhiy-storchaka
      added 3 commits that reference this issue on Dec 4, 2022

      pythongh-60203: Revert changes in cycle.__setstate__

      dd07082

      pythongh-60203: Always pass True/False as boolean arguments in tests

      e7fc154

      gh-60203: Always pass True/False as boolean arguments in tests (GH-99983

      76f43fc
    16. miss-islington
      added a commit that references this issue on Dec 4, 2022

      pythongh-60203: Always pass True/False as boolean arguments in tests (p…

      6a0c576
    17. serhiy-storchaka
      added a commit that references this issue on Dec 4, 2022

      [3.10] pythongh-60203: Always pass True/False as boolean arguments in…

      f279305
    18. miss-islington
      added a commit that references this issue on Dec 4, 2022

      gh-60203: Always pass True/False as boolean arguments in tests (GH-99983

      7aa87bb
    19. serhiy-storchaka
      added a commit that references this issue on Dec 4, 2022

      [3.10] gh-60203: Always pass True/False as boolean arguments in tests (…

      ac78128
    20. serhiy-storchaka commented on Dec 5, 2022

      @serhiy-storchaka
      serhiy-storchaka
      on Dec 5, 2022
      MemberAuthor
      More actions

      Opened a discussion: https://discuss.python.org/t/boolean-arguments/21662

      Gregory, please join. Feel free to rewrite my post or add your explanations (you are better in this).

      Reacted by Gregory P. Smith
    21. ambv
      added 5 commits that reference this issue on Dec 5, 2022

      gh-60203: Revert changes in cycle.__setstate__ (#99982)

      922a6cf

      [3.11] pythongh-60203: Revert changes in cycle.__setstate__ (pythonGH…

      4c90822

      [3.10] pythongh-60203: Revert changes in cycle.__setstate__ (pythonGH…

      83b65cb

      [3.10] gh-60203: Revert changes in cycle.__setstate__ (GH-99982) (#10…

      b914eee

      [3.11] gh-60203: Revert changes in cycle.__setstate__ (GH-99982) (#10…

      32a2193
    22. serhiy-storchaka commented on Sep 7, 2023

      @serhiy-storchaka
      serhiy-storchaka
      on Sep 7, 2023
      MemberAuthor
      More actions

      Seems the decision was to simply accept this. So I close this issue.

    23. serhiy-storchaka
      closed this as completedon Sep 7, 2023
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    • @gpshead
      gpshead
    • @serhiy-storchaka
      serhiy-storchaka

    Labels

    3.12only security fixesonly security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.