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 — Add sys.isinterned() · Issue #78573 · python/cpython

Add sys.isinterned() #78573

New issue
Copy link
New issue
Copy link
Closed
Closed
Add sys.isinterned()#78573
Copy link
Labels
3.8 (EOL)end of lifeend of lifeinterpreter-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 Aug 13, 2018
Issue body actions
BPO 34392
Nosy @warsaw, @brettcannon, @rhettinger, @ronaldoussoren, @tiran, @serhiy-storchaka
PRs
  • bpo-34392: Add sys. _is_interned() #8755
  • 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 2018-08-13.10:24:33.256>
    labels = ['interpreter-core', 'type-feature', '3.8']
    title = 'Add sys.isinterned()'
    updated_at = <Date 2018-08-19.06:55:15.282>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2018-08-19.06:55:15.282>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Interpreter Core']
    creation = <Date 2018-08-13.10:24:33.256>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 34392
    keywords = ['patch']
    message_count = 5.0
    messages = ['323473', '323474', '323539', '323545', '323744']
    nosy_count = 6.0
    nosy_names = ['barry', 'brett.cannon', 'rhettinger', 'ronaldoussoren', 'christian.heimes', 'serhiy.storchaka']
    pr_nums = ['8755']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue34392'
    versions = ['Python 3.8']

    Activity

    1. serhiy-storchaka commented on Aug 13, 2018

      @serhiy-storchaka
      serhiy-storchaka
      on Aug 13, 2018
      MemberAuthor
      More actions

      I need to test whether the string is interned for Python implementations of marshal.dumps(). It is easy to do in C, and I suggest to expose this functionality to Python.

      Currently you can test if the string is interned using the following function:

          def isinterned(s):
              return sys.intern(s) is s

      But it has a side effect -- it interns a string if it is not equal to an already interned string.

    2. serhiy-storchaka
      added
      3.8 (EOL)end of lifeend of life
      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 Aug 13, 2018
    3. tiran commented on Aug 13, 2018

      @tiran
      tiran
      on Aug 13, 2018
      Member
      More actions

      I'd prefer to have this as an internal API, either sys._isinterned() or as a helper method in testcapi.

    4. brettcannon commented on Aug 14, 2018

      @brettcannon
      brettcannon
      on Aug 14, 2018
      Member
      More actions

      I agree with Christian; this is an implementation detail so it should be flagged as private/internal somehow.

    5. warsaw commented on Aug 15, 2018

      @warsaw
      warsaw
      on Aug 15, 2018
      Member
      More actions

      Agreed it should be non-public, but can we please call it sys._is_interned()?

    6. serhiy-storchaka commented on Aug 19, 2018

      @serhiy-storchaka
      serhiy-storchaka
      on Aug 19, 2018
      MemberAuthor
      More actions

      Thank you all for the feedback. The function is renamed to sys._is_interned() and documented as optional.

    7. ezio-melotti
      transferred this issue fromon Apr 10, 2022
    8. serhiy-storchaka
      closed this as completedon Dec 4, 2023
    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.8 (EOL)end of lifeend of lifeinterpreter-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.