On Thu, 02 Aug 2007 15:03:42 +0000, Stargaming wrote: > On Sat, 28 Jul 2007 17:06:50 +0200, tomer filiba wrote: > >> currently, testing for "x in xrange(y)" is an O(n) operation. >> >> since xrange objects (which would become range in py3k) are not real >> lists, there's no reason that __contains__ be an O(n). it can easily be >> made into an O(1) operation. here's a demo code (it should be trivial >> to implement this in CPython) [snipped algorithm] > > I gave the implementation a try. [snipped patch details] > > Should I submit the patch to the SF patch manager as well?
Guido> Yes, please submit to SF. Submitted to the SF patch manager as patch #1766304. It is marked as a Python 2.6 item. http://sourceforge.net/tracker/index.php? func=detail&aid=1766304&group_id=5470&atid=305470 Regards, Stargaming _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
