In 4bb802f7$0$8827$c3e8...@news.astraweb.com Steven D'Aprano
st...@remove-this-cybersource.com.au writes:
On Sat, 03 Apr 2010 22:58:43 +, kj wrote:
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
On Apr 5, 11:49 am, kj no.em...@please.post wrote:
In 4bb802f7$0$8827$c3e8...@news.astraweb.com Steven D'Aprano
st...@remove-this-cybersource.com.au writes:
On Sat, 03 Apr 2010 22:58:43 +, kj wrote:
Suppose I have a function with the following signature:
def spam(x, y, z):
#
On 4 Apr, 00:58, kj no.em...@please.post wrote:
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.)
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
On Sat, 3 Apr 2010 22:58:43 + (UTC) kj no.em...@please.post wrote:
The best I have managed looks like this:
class _Spam(object):
def __init__(self, x, y, z):
self.__dict__ = OrderedDict(())
for p in inspect.getargspec(_Spam.__init__).args[1:]:
kj wrote:
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.)
It sounds like you want the * operator
kj wrote:
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
On Sat, Apr 3, 2010 at 6:28 PM, kj no.em...@please.post wrote:
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.)
def spam(*args, **kwargs):
print args
print kwargs
class Spam:
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 @_
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
On Sat, 3 Apr 2010 23:52:42 + (UTC) kj no.em...@please.post wrote:
In hp8h73$k1...@reader1.panix.com kj no.em...@please.post writes:
[snip]
P.S. this is just an example; the function I want to implement has
more parameters in its signature, with longer, more informative
names.
On 2010-04-03, kj no.em...@please.post wrote:
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
On Sat, 03 Apr 2010 22:58:43 +, kj wrote:
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.)
13 matches
Mail list logo