> def cross_nodups(*args):
> 'Cross product after eliminating repeat elements, keeping constant
> size'
> ans = [[]]
> for arg in args:
> ans = [x+[y] for x in ans for y in arg if y not in x]
> return ans
>
> def choose_first(obj1, *args):
> 'Assume a choice of a first o
On Oct 26, 2:33 am, Raymond Hettinger <[EMAIL PROTECTED]> wrote:
> On Oct 25, 8:31 am, [EMAIL PROTECTED] wrote:
>
>
>
> > I've got a little issue, both programming and performance-wise. I have
> > a set, containing objects that refer to other sets. For example, in a
> > simple notation: (, ) (or in
> Easy exercise of transforming recursion to iteration left to the
> reader.
Ack! That part was already done.
Raymond
--
http://mail.python.org/mailman/listinfo/python-list
On Oct 25, 8:31 am, [EMAIL PROTECTED] wrote:
> I've got a little issue, both programming and performance-wise. I have
> a set, containing objects that refer to other sets. For example, in a
> simple notation: (, ) (or in a more object-like
> display: set(obj1.choices=set(a, b, c) ). There may be ob
On Oct 25, 8:44 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> On Oct 25, 10:31 am, [EMAIL PROTECTED] wrote:
>
>
>
> > Hello everyone,
>
> > I've got a little issue, both programming and performance-wise. I have
> > a set, containing objects that refer to other sets. For example, in a
> > sim
On Oct 25, 10:31 am, [EMAIL PROTECTED] wrote:
> Hello everyone,
>
> I've got a little issue, both programming and performance-wise. I have
> a set, containing objects that refer to other sets. For example, in a
> simple notation: (, ) (or in a more object-like
> display: set(obj1.choices=set(a, b,
Hello everyone,
I've got a little issue, both programming and performance-wise. I have
a set, containing objects that refer to other sets. For example, in a
simple notation: (, ) (or in a more object-like
display: set(obj1.choices=set(a, b, c) ). There may be obj1..objN
objects in the outer set, a