[Python-ideas] Keyword/Symbol literals

Alexander Belopolsky alexander.belopolsky at gmail.com
Wed Jan 21 20:38:42 CET 2015

On Wed, Jan 21, 2015 at 2:13 PM, Guido van Rossum <guido at python.org> wrote:

> Lack of a use case?

My use case comes from interoperability with other languages.  I maintain a
package which provides an interface [1] between Python and the language [2]
called Q.  Q has 3 scalar types to represent text data (char, byte and
symbol) and the corresponding vector types.  When I pass Python strings to
Q, I convert them to symbols because that is what users expect most of the
time, but as a result, working with char vectors is unnatural.  I currently
use bytes type for that, but it is really an abuse because bytes should map
to byte vectors.

I realize that mine is a niche application, but the same problem is likely
to arise with other data systems that have "symbol" or categorical type.

[1] http://code.kx.com/wiki/Contrib/PyQ
[2] http://kx.com/q/d/q.htm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150121/7180a118/attachment-0001.html>

More information about the Python-ideas mailing list