Re: Initializing with the correct type

2006-12-07 Thread szabi
g > for i in L: > if type(i) is not int: > raise FormatError, "L must contain ints" if you need something for holding only ints, you could use the array module: >>> import array >>> a = array.array(&

pythonic way of 'b = list(a); b.append(4)"

2006-02-16 Thread szabi
this: f(list(a).functional_append(4)) I can't modify 'a'. Thanks, Szabi -- http://mail.python.org/mailman/listinfo/python-list

Re: pythonic way of 'b = list(a); b.append(4)"

2006-02-16 Thread szabi
)) was the same as with the others' involving functions. Actually what I missed is the fact that the + operator works fine with lists... With '+' I can solve everything. Ok, _almost_ everything :) Thanks for everybody! Szabi -- http://mail.python.org/mailman/listinfo/python-list