[issue34392] Add sys.isinterned()

2018-08-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

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

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34392] Add sys.isinterned()

2018-08-14 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:

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

--
nosy: +barry

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34392] Add sys.isinterned()

2018-08-14 Thread Brett Cannon


Brett Cannon  added the comment:

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

--
nosy: +brett.cannon

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34392] Add sys.isinterned()

2018-08-13 Thread Christian Heimes


Christian Heimes  added the comment:

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

--
nosy: +christian.heimes

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34392] Add sys.isinterned()

2018-08-13 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +8231
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34392] Add sys.isinterned()

2018-08-13 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com