Skip to content

Correct and deduplicate docs on "printable" characters #82045

Closed

Description

@gnprice
BPO 37864
Nosy @vstinner, @ezio-melotti, @gnprice
PRs
  • bpo-37864: Correct and deduplicate "isprintable" docs; add test. #15300
  • 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 2019-08-15.04:40:26.339>
    labels = ['3.8', 'expert-unicode']
    title = 'Correct and deduplicate docs on "printable" characters'
    updated_at = <Date 2019-08-15.04:43:18.597>
    user = 'https://github.com/gnprice'

    bugs.python.org fields:

    activity = <Date 2019-08-15.04:43:18.597>
    actor = 'Greg Price'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Unicode']
    creation = <Date 2019-08-15.04:40:26.339>
    creator = 'Greg Price'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 37864
    keywords = ['patch']
    message_count = 1.0
    messages = ['349792']
    nosy_count = 3.0
    nosy_names = ['vstinner', 'ezio.melotti', 'Greg Price']
    pr_nums = ['15300']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue37864'
    versions = ['Python 3.8']

    Linked PRs

    Activity

    1. gnprice commented on Aug 15, 2019

      @gnprice
      ContributorAuthor

      While working on bpo-36502 and then bpo-18236 about the definition and docs of str.isspace(), I looked closely also at its neighbor str.isprintable().

      It turned out that we have the definition of what makes a character "printable" documented in three places, giving two different definitions.

      The definition in the comment on _PyUnicode_IsPrintable is inverted, so that's an easy small fix.

      With that correction, the two definitions turn out to be equivalent -- but to confirm that, you have to go look up, or happen to know, that those are the only five "Other" categories and only three "Separator" categories in the Unicode character database. That makes it hard for the reader to tell whether they really are the same, or if there's some subtle difference in the intended semantics.

      I've taken a crack at writing some improved docs text for a single definition, borrowing ideas from the C comment as well as the existing docs text; and then pointing there from the other places we'd had definitions. PR coming shortly.

    2. transferred this issue fromon Apr 10, 2022
    3. added
      docs
      3.11
      3.10 (EOL)
      3.12
      and removed
      3.8 (EOL)
      on Apr 4, 2023
    4. added a commit that references this issue on Feb 14, 2025
    5. added 2 commits that reference this issue on Feb 14, 2025
    6. removed
      3.11
      3.10 (EOL)
      3.12
      on Feb 14, 2025
    7. added 2 commits that reference this issue on Feb 17, 2025
    8. encukou commented on Feb 17, 2025

      @encukou
      Member

      Thank you for the patch, and sorry for the wait!

    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

      docstopic-unicode

      Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions