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 — Clarify argument type of platform.platform(aliased, terse) to boolean · Issue #91038 · python/cpython

Clarify argument type of platform.platform(aliased, terse) to boolean #91038

New issue
Copy link
New issue
Copy link
Closed
Closed
Clarify argument type of platform.platform(aliased, terse) to boolean#91038
Copy link
Labels
3.10 (EOL)end of lifeend of life3.11only security fixesonly security fixes3.7 (EOL)end of lifeend of life3.8 (EOL)end of lifeend of life3.9 (EOL)end of lifeend of lifedocsDocumentation in the Doc dirDocumentation in the Doc dirstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

Description

Rotzbua
mannequin
opened on Feb 28, 2022
Issue body actions
BPO 46882
Nosy @stevendaprano, @Rotzbua
PRs
  • bpo-46882: Clarify argument type of platform.platform(aliased, terse) to boolean #31617
  • gh-91038: Change default argument value to False instead of 0 #31621
  • 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 2022-02-28.14:28:31.784>
    labels = ['3.7', '3.8', '3.9', 'type-feature', 'docs', '3.10', '3.11', 'library']
    title = 'Clarify argument type of platform.platform(aliased, terse) to boolean'
    updated_at = <Date 2022-02-28.18:49:58.262>
    user = 'https://github.com/Rotzbua'

    bugs.python.org fields:

    activity = <Date 2022-02-28.18:49:58.262>
    actor = 'Rotzbua'
    assignee = 'docs@python'
    closed = False
    closed_date = None
    closer = None
    components = ['Documentation', 'Library (Lib)']
    creation = <Date 2022-02-28.14:28:31.784>
    creator = 'Rotzbua'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 46882
    keywords = ['patch']
    message_count = 4.0
    messages = ['414198', '414199', '414205', '414213']
    nosy_count = 3.0
    nosy_names = ['steven.daprano', 'docs@python', 'Rotzbua']
    pr_nums = ['31617', '31621']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue46882'
    versions = ['Python 3.7', 'Python 3.8', 'Python 3.9', 'Python 3.10', 'Python 3.11']

    Activity

    1. Rotzbua commented on Feb 28, 2022

      @Rotzbua
      Rotzbuamannequin
      on Feb 28, 2022
      MannequinAuthor
      More actions

      Problem:
      Both arguments aliased and terse should be boolean instead of integer.

      Description:
      The function is as platform.platform(aliased=0, terse=0) so both arguments aliased and terse seems to be numbers.
      The documentation says: "If aliased is true,[..]" which gives a hint that the type should be boolean instead of an integer.
      Looking into the implementation both arguments used as boolean.

      Solution:
      Update documentation and set default argument values to False instead of 0.

      Reference:
      Current documentation: https://docs.python.org/3.11/library/platform.html#platform.platform

    2. Rotzbua
      added
      3.7 (EOL)end of lifeend of life
      3.8 (EOL)end of lifeend of life
      3.9 (EOL)end of lifeend of life
      3.10 (EOL)end of lifeend of life
      3.11only security fixesonly security fixes
      on Feb 28, 2022
    3. Rotzbua
      assigned
      docspython
      on Feb 28, 2022
    4. Rotzbua
      added
      docsDocumentation in the Doc dirDocumentation in the Doc dir
      stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
      type-featureA feature request or enhancementA feature request or enhancement
      3.7 (EOL)end of lifeend of life
      3.8 (EOL)end of lifeend of life
      3.9 (EOL)end of lifeend of life
      on Feb 28, 2022
    5. stevendaprano commented on Feb 28, 2022

      @stevendaprano
      stevendaprano
      on Feb 28, 2022
      Member
      More actions

      Both arguments aliased and terse should be boolean instead of integer.

      Why should they be strictly True/False booleans? I disagree strongly that they should be. Any object that duck-types as a true or false value is sufficient.

      Treated as a documentation change, your PR is wrong because it implies that only the singletons True and False are acceptable, when in fact any true and false (note the lowercase) values are acceptable.

      Personally, I prefer the terms "truthy" and "falsey", or "a true value" and "a false value" over a bare true/false, but some people do not, and it is a long-standing tradition in Python circles to understand lowercase true/false as the duck-typed values as opposed to the True and False bool singletons.

    6. stevendaprano commented on Feb 28, 2022

      @stevendaprano
      stevendaprano
      on Feb 28, 2022
      Member
      More actions

      See bpo-46883

    7. Rotzbua commented on Feb 28, 2022

      @Rotzbua
      Rotzbuamannequin
      on Feb 28, 2022
      MannequinAuthor
      More actions

      Thanks for pointing out the logical change from "true" to "True".
      I do not want to start a discussion about principles.

      Nevertheless I think a change from platform(aliased=0, terse=0) to platform(aliased=False, terse=False) makes the how-to-use more intuitive.

      The change does not change any function behavior or breaks any backwards compatibilities.

      I created a new PR without the change of "true".

    8. ezio-melotti
      transferred this issue fromon Apr 10, 2022
    9. JelleZijlstra
      added a commit that references this issue on Feb 27, 2023

      gh-91038: Change default argument value to `False` instead of `0` (#3…

      f3cb15c
    10. JelleZijlstra
      closed this as completedon Feb 27, 2023
    11. carljm
      added a commit that references this issue on Feb 28, 2023

      Merge branch 'main' into inlinecomp2

      73dc0ed
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.10 (EOL)end of lifeend of life3.11only security fixesonly security fixes3.7 (EOL)end of lifeend of life3.8 (EOL)end of lifeend of life3.9 (EOL)end of lifeend of lifedocsDocumentation in the Doc dirDocumentation in the Doc dirstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-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.