Author loewis
Recipients ezio.melotti, gvanrossum, lemburg, loewis, mrabarnett, tchrist, terry.reedy
Date 2011-09-30.10:00:48
SpamBayes Score 2.98645e-10
Marked as misclassified No
Message-id <1317376849.61.0.0384730043577.issue12753@psf.upfronthosting.co.za>
In-reply-to
Content
I propose to use a better lookup algorithm using binary search, and then integrate the NamedSequences into this as well. The search result could be a record

 struct {
   char *name;
   int len;
   Py_UCS4 chars[3]; /* no sequence is more than 3 chars */
 }

You would have two tables for these: one for the aliases, and one for the named sequences.

_getcode would continue to return a single char only, and thus not support named sequences. lookup could well return strings longer than 1, but only in 3.3.

I'm not sure that \N escapes should support named sequences: people rightfully expect that each escaped element in a string literal constitutes exactly one character.
History
Date User Action Args
2011-09-30 10:00:49loewissetrecipients: + loewis, lemburg, gvanrossum, terry.reedy, ezio.melotti, mrabarnett, tchrist
2011-09-30 10:00:49loewissetmessageid: <1317376849.61.0.0384730043577.issue12753@psf.upfronthosting.co.za>
2011-09-30 10:00:49loewislinkissue12753 messages
2011-09-30 10:00:48loewiscreate