a flattening operator?

Lawrence D'Oliveiro ldo at geek-central.gen.new_zealand
Sat Apr 22 05:48:57 EDT 2006


In article <1145317740.898240.172830 at i39g2000cwa.googlegroups.com>,
 "gangesmaster" <tomerfiliba at gmail.com> wrote:

>as we all know, * (asterisk) can be used to "inline" or "flatten" a
>tuple into an argument list, i.e.:
>
>def f(a, b, c):
>    ...
>x = (1,2,3)
>f(*x)
>
>so... mainly for symmetry's sake, why not make a "flattening" operator
>that also works outside the context of function calls?

    def flatten(*a) :
        return a



More information about the Python-list mailing list