Re: Is there such an idiom?

2006-03-20 Thread Bruce Cropley
Per wrote: > http://jaynes.colorado.edu/PythonIdioms.html [snip] > Is this correct? > s = [1,2,3,4,5...] > t = [4,5,6,,8,...] > how to find whether there is/are common item(s) between two list in > linear-time? > how to find the number of common items between two list in linear-time? A common te

Re: beta.python.org content

2006-01-28 Thread Bruce Cropley
I'd like to see the use of Python grow as dramatically as it deserves to. As I see it, there are at least three major categories of web visitors that we need to cater to: - Existing python users - Potential python users - Managers The current site's front page seems to be aimed mainly at existing

Re: decorators to add test* TestCase methods

2006-01-27 Thread Bruce Cropley
Many thanks for that! It looks like it's time to learn about metaclasses. :) -- http://mail.python.org/mailman/listinfo/python-list

decorators to add test* TestCase methods

2006-01-27 Thread Bruce Cropley
Hi all I'm trying to generate test methods in a unittest TestCase subclass, using decorators. I'd like to be able to say: class MyTestCase(unittest.TestCase): @genTests(["Buy", "Sell"], [1,2,3], [True, False]) def something(self, side, price, someFlag): # etc... And have it gene