Re: functions with unlimeted variable arguments...

2005-06-20 Thread Peter Hansen
Xah Lee wrote:
 oops... it is in the tutorial... sorry.

If you're sorry, have you now *finally* gone and worked through the rest 
of tutorial, making a serious attempt to learn it?

 This is not a rhetorical question, but where would one start to look
 for it in the python ref?
 
 a language is used by programers. Subroutine definition with
 variable/default parameters is a basic issue a programer wants to know,
 and different languages differs very much in how they handle this. This
 is what i mean that the language doc should be programing oriented, as
 opposed to computer-sciency or implementation oriented...

You seem to be under the impression that most programmers learn a new 
language by looking up key phrases such as variable argument list in 
the index of their new language's manual as they encounter the need for 
a feature.

In actual fact, most programmers learn by finding a tutorial or 
convenient beginner's lesson (hint hint), and then by browsing through 
other material such as a FAQ (hint hint), and then perhaps by skimming 
quickly through the reference material to learn what is there.  This way 
they avoid making themselves look like complete and utter fools by 
appearing to learn only by looking up things in the index.

-Peter
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: functions with unlimeted variable arguments...

2005-06-19 Thread Xah Lee
oops... it is in the tutorial... sorry.

though, where would one find it in the python reference?
i.e. the function def with variable/default parameters.

This is not a rhetorical question, but where would one start to look
for it in the python ref?

a language is used by programers. Subroutine definition with
variable/default parameters is a basic issue a programer wants to know,
and different languages differs very much in how they handle this. This
is what i mean that the language doc should be programing oriented, as
opposed to computer-sciency or implementation oriented...

 Xah
 [EMAIL PROTECTED]
 http://xahlee.org/

-- 
http://mail.python.org/mailman/listinfo/python-list

Re: functions with unlimeted variable arguments...

2005-06-19 Thread Robert Kern
Xah Lee wrote:
 oops... it is in the tutorial... sorry.
 
 though, where would one find it in the python reference?
 i.e. the function def with variable/default parameters.
 
 This is not a rhetorical question, but where would one start to look
 for it in the python ref?

Oddly enough, http://docs.python.org/ref/function.html

-- 
Robert Kern
[EMAIL PROTECTED]

In the fields of hell where the grass grows high
  Are the graves of dreams allowed to die.
   -- Richard Harter

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: functions with unlimeted variable arguments...

2005-06-19 Thread Diez B. Roggisch
Xah Lee wrote:
 oops... it is in the tutorial... sorry.
 
 though, where would one find it in the python reference?
 i.e. the function def with variable/default parameters.
 
 This is not a rhetorical question, but where would one start to look
 for it in the python ref?

 a language is used by programers. Subroutine definition with
 variable/default parameters is a basic issue a programer wants to know,
 and different languages differs very much in how they handle this. This
 is what i mean that the language doc should be programing oriented, as
 opposed to computer-sciency or implementation oriented...

Basically this boils down to you being to stupid to know the difference 
between a library reference and a language reference.

And still you consider yourself to be above reading the tutorial in the 
first place to grasp even the simplest aspects about python? Gosh, this 
certainly isn't the first, but certainly one of the most enjoyable 
moronities you've been presenting to us. When does it occur to you that 
that type of moron-centric documentation you're bragging about is not 
needed by anybody else than you?

So start writing An introduction to Python for morons, by a moron - the 
Xah Lee Files yourself - take your time, apart from you nobody needs 
it. Really.

And stop annoying people who are willing to help others seeking advice 
who do show the will and abilities to actually dig into something and 
learn instead of crying out in rage all the time because python (or it's 
docs for that matter) doesn't seem to fit what your obviously severely 
limited understanding of concepts behind programming and computers in 
general tells you it should be.

But I have the feeling you won't restrain yourself from blathering away 
in this NG - so thank god to killfiles...

Diez
-- 
http://mail.python.org/mailman/listinfo/python-list


functions with unlimeted variable arguments...

2005-06-18 Thread Xah Lee
how can i define a function with variable parameters? For example,

f(a) would return [a]
f(a,b) would return [a,b]
f(a,b,...) would return [a,b,...]

One solution is of course to make the argument as a list. i.e.
f([a,b,...])
but are there other solutions?

 Xah
 [EMAIL PROTECTED]
 http://xahlee.org/

-- 
http://mail.python.org/mailman/listinfo/python-list

Re: functions with unlimeted variable arguments...

2005-06-18 Thread Paul Rubin
Xah Lee [EMAIL PROTECTED] writes:
 but are there other solutions?
 
  Xah

Geez man, haven't you been around long enough to read the manual?

def f(*a): return a
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: functions with unlimeted variable arguments...

2005-06-18 Thread John Machin
Xah Lee wrote:
 how can i define a function with variable parameters? For example,
 
 f(a) would return [a]
 f(a,b) would return [a,b]
 f(a,b,...) would return [a,b,...]
 
 One solution is of course to make the argument as a list. i.e.
 f([a,b,...])
 but are there other solutions?
 
 def foo(*args):
... print repr(args)
... return list(args)
...
 foo()
()
[]
 foo(42)
(42,)
[42]
 foo(666, 'hello', 1.234)
(666, 'hello', 1.234)
[666, 'hello', 1.234]


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: functions with unlimeted variable arguments...

2005-06-18 Thread Ivan Van Laningham
Hi All--

Paul Rubin wrote:
 
 Xah Lee [EMAIL PROTECTED] writes:
  but are there other solutions?
 
   Xah
 
 Geez man, haven't you been around long enough to read the manual?
 
 def f(*a): return a


He's been around long enough to rewrite the manual.

Metta,
if-he-succeeds-we'll-all-have-to-take-up-perl-ly y'rs,
Ivan
--
Ivan Van Laningham
God N Locomotive Works
http://www.andi-holmes.com/
http://www.foretec.com/python/workshops/1998-11/proceedings.html
Army Signal Corps:  Cu Chi, Class of '70
Author:  Teach Yourself Python in 24 Hours
-- 
http://mail.python.org/mailman/listinfo/python-list