"Mr.Rech" <[EMAIL PROTECTED]> writes:
> Hi all,
> I was writing a simple class when I get a strange error message that I
> can't
> understand. Hopefully someone could help me here.
>
> My class's init method takes a list of lists as input argument and I'd
> like to create
> several attributes each
Mr.Rech a écrit :
(snip)
>
> My class's init method takes a list of lists as input argument and I'd
> like to create
> several attributes each one referencing one item of the passed list.
>
> Easy-of-use arguments
> has led me to call these attributes as x0, x1, x2 and so on.
This is a very wro
I would have sworn that it had been a better way to get it.
Thanks a lot,
Andrea
--
http://mail.python.org/mailman/listinfo/python-list
"Mr.Rech" wrote:
> class foo(object):
>def __init__(self, list_of_lists):
>self.lol = list(list_of_lists)
>
>for i in range(len(list_of_lists)):
>exec 'self.x%d = self.lol[%d]' % (i, i)
>
>self.shape = tuple(len(item) for item in self.lol)
generator express
Hi all,
I was writing a simple class when I get a strange error message that I
can't
understand. Hopefully someone could help me here.
My class's init method takes a list of lists as input argument and I'd
like to create
several attributes each one referencing one item of the passed list.
Easy-of-