In <hp8kc9$dg...@reader1.panix.com> kj <no.em...@please.post> writes:
>In <hp8h73$k1...@reader1.panix.com> kj <no.em...@please.post> writes: >>Suppose I have a function with the following signature: >>def spam(x, y, z): >> # etc. >>Is there a way to refer, within the function, to all its arguments >>as a single list? (I.e. I'm looking for Python's equivalent of >>Perl's @_ variable.) >>I'm aware of locals(), but I want to preserve the order in which >>the arguments appear in the signature. >>My immediate aim is to set up a simple class that will allow me to >>iterate over the arguments passed to the constructor (plus letS me > ^^^^^^^^^^^^ >>refer to these individual arguments by their names using an > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >>instance.attribute syntax, as usual). > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >The underlined portion explains why __init__(self, *args) fails to >fit the bill. The minute I hit "send" I realized that this is wrong. Sorry. Thanks. -- http://mail.python.org/mailman/listinfo/python-list