[New-bugs-announce] [issue34392] Add sys.isinterned()

Serhiy Storchaka report at bugs.python.org
Mon Aug 13 06:24:33 EDT 2018


New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>:

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.

----------
components: Interpreter Core
messages: 323473
nosy: rhettinger, ronaldoussoren, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Add sys.isinterned()
type: enhancement
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34392>
_______________________________________


More information about the New-bugs-announce mailing list