Regular expression as dictionary key?

Martin von Loewis loewis at
Mon Dec 3 05:59:36 EST 2001

Luke <LLoeffler at> writes:

> So you add a few lines to go exhaustively through the keys and 
> accumulate matches... Still linear.  I admitedly don't know much about 
> the C implementation of dicts, but it seems there should be a way to 
> leverage the dict's arrangement for fast regex keys.

You mean, you can inspect every element of a set in sub-linear time? I
guess you can solve P==NP as well :-)


More information about the Python-list mailing list