"Rob Richardson" writes:
> My thanks both to the original poster and to JM for an excellent answer.
> I saw this syntax for the first time recently, and I've been curious
> about it too.
Would it be correct of me to assume that you have not worked through the
entire Python tutorial http://docs.p
My thanks both to the original poster and to JM for an excellent answer.
I saw this syntax for the first time recently, and I've been curious
about it too.
RobR
--
http://mail.python.org/mailman/listinfo/python-list
sl33k_ wrote:
Hi,
I am struggling to grasp this concept about def foo(*args). Also, what
is def bar(*args, *kwargs)?
Isnt it like self must be the first parameter to the method/function?
If not what are the exceptions?
Also, can the terms method and function be used interchangeably?
TIA
"
On Jan 31, 12:35 am, rantingrick wrote:
> > Also, can the terms method and function be used interchangeably?
>
> Can the terms cars and truck be used interchangeably?
Oooff! A load of meaning in that one line -- I wonder though if the OP
will understand...
--
http://mail.python.org/mailman/listi
sl33k_ writes:
> I am struggling to grasp this concept about def foo(*args). Also, what
> is def bar(*args, *kwargs)?
Please work through the Python Tutorial from start to finish
http://docs.python.org/tutorial/>, performing each exercise and
experimenting with it until you understand. You will
sl33k_ wrote:
> Isnt it like self must be the first parameter to the method/function?
"self" is just customary as first parameter to memberfunctions, the
language itself doesn't impose this convention, as e.g. C++ does with its
"this".
> Also, can the terms method and function be used intercha
On Sun, Jan 30, 2011 at 11:26 AM, sl33k_ wrote:
> Hi,
>
> I am struggling to grasp this concept about def foo(*args).
The interactive interpreter is your friend! Try experimenting with it next time!
http://docs.python.org/tutorial/controlflow.html#arbitrary-argument-lists
That `def` defines a va
sl33k_ wrote:
> Hi,
>
> I am struggling to grasp this concept about def foo(*args). Also, what
> is def bar(*args, *kwargs)?
>
> Isnt it like self must be the first parameter to the method/function?
> If not what are the exceptions?
>
> Also, can the terms method and function be used interchang
On Jan 30, 1:26 pm, sl33k_ wrote:
> Hi,
>
> I am struggling to grasp this concept about def foo(*args). Also, what
> is def bar(*args, *kwargs)?
FYI: the python intepretor is your friend!
py> def foo(*args):
print args
py> foo(1)
(1,)
py> foo(1,2,3)
(1, 2, 3)
py> foo(1,[1,23], {'hat':
Sorry that parameter is **kwargs.
--
http://mail.python.org/mailman/listinfo/python-list
10 matches
Mail list logo