Martin v. Löwis <mar...@v.loewis.de> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12753>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to