James Stroud a écrit : > SuperHik wrote: > >> and the winner is... :D >> David Isaac wrote: >> >>> alpha = string.lowercase >>> x=(a+b+c for a in alpha for b in alpha for c in alpha) >> >> >> >> > > Not necessarily vying for winner, but David's solution is highly > specific as it doesn't do so well for something like > > aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa > aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab > . > . > . > zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzy > zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz >
And ? Was it asked for ? I'd personaly start with David's solution - IOW : simplest thing that could possibly work -, and only bother making it more generic if/when I have a use case for a more generic solution. Premature generalisation is the root of all evil !-) -- http://mail.python.org/mailman/listinfo/python-list