Re: Python docs [was: function with a state]

2005-03-28 Thread Mark McIntyre
On 28 Mar 2005 03:56:42 -0800, in comp.lang.c , "Xah Lee" <[EMAIL PROTECTED]> wrote: >Python doc “3.6.4 Mutable Sequence Types” at (whatever) will you /please/ stop crossposting this python thread to comp.lang.c. (FUP's set to exclude CLC, please respect this) -- Mark McIntyre CLC FAQ

Re: Python docs [was: function with a state]

2005-03-28 Thread Xah Lee
Python doc â3.6.4 Mutable Sequence Typesâ at http://python.org/doc/2.4/lib/typesseq-mutable.html in which contains the documentation of the âsortâ method of a list. Quote: -- .sort([cmp[, key[, reverse]]]) sort the items of s in place (7), (8), (9), (10) ... (8) The sort() method

Re: Python docs [was: function with a state]

2005-03-25 Thread Keith Thompson
Please stop cross-posting this stuff! -- Keith Thompson (The_Other_Keith) [EMAIL PROTECTED] San Diego Supercomputer Center <*> We must do something. This is something. Therefore, we must do this. -- http://mail.python.org/m

Re: Python docs [was: function with a state]

2005-03-25 Thread Ulrich Hobelmann
[EMAIL PROTECTED] wrote: The Python doc, though relatively incompetent, but the author have Really, how could those morons even dream of creating a language, and even writing docs to accompany it?? tried the best. This is in contrast to documentations in unix related things (unix tools, perl, apa

Re: Python docs [was: function with a state]

2005-03-25 Thread axel
In comp.lang.perl.misc Xah Lee <[EMAIL PROTECTED]> wrote: > The Python doc is relatively lousy, from content organization to the > tech writing quality. Which has precisely what to do with most of the groups to which you cross-posted? > Problem: They all have the same priority (which is higher th

Re: Python docs [was: function with a state]

2005-03-25 Thread John Bokma
Martin Ambuhl wrote: > Apologies to these various newsgroups, but I have no idea which one Xah > Lee actually reads or posts from. F'ups set. Probably none, since they are all crowded with crazy linux zealots :-D. -- John Small Perl scripts: http://johnbokma.com/perl/

Re: Python docs [was: function with a state]

2005-03-25 Thread John Bokma
Xah Lee wrote: > The Python doc is relatively lousy, from content organization to the > tech writing quality. So write your own or fork the current one. I doubt if that's a problem. Did you read Dive into Python? -- John Small Perl scripts: http://johnbokma.com/perl/

Re: Python docs [was: function with a state]

2005-03-24 Thread Xah Lee
umm... looks like it should've been: Comparison can be chained, and is equivalent to a sequence of comparisons with âandâ in between. For example, âxhttp://xahlee.org/ Terry Reedy wrote: > >Comparisons can be chained, and is evaluated from left to right. For > >example, x < y <= z is equivalent t

Re: Python docs [was: function with a state]

2005-03-24 Thread Xah Lee
there is a Python, pithy mighty, lissome, and tabby algorithms it puffs tim-toady it engulfs and sways universality there is a camel, lanky ugly, petty, ungainly foolhardy comports hacking it supports and toadies eunuch's fancy Xah [EMAIL PROTECTED] â http://xahlee.org/PageTwo_dir/more.html M

Re: Python docs [was: function with a state]

2005-03-24 Thread CBFalconer
Martin Ambuhl wrote: > Xah Lee wrote: > >> The Python doc is relatively lousy, from content organization to >> the tech writing quality. >> >> I think i'll just post snippets of my comments as i find them. >> (and feel like exposing) > > The cross-posting idiot is back. Next he'll be posting his

Re: Python docs [was: function with a state]

2005-03-24 Thread Leif K-Brooks
Xah Lee wrote: The word âobjectâ has generic English meaning as well might have very technical meaning in a language. In Python, it does not have very pronounced technical meaning. For example, there's a chapter in Python Library Ref titled â2. Built-In Objectsâ, and under it a section â2.1 Built-i

Re: Python docs [was: function with a state]

2005-03-24 Thread Erik Max Francis
Xah Lee wrote: Very fucking stupid confusional writing. I agree. Oh, were you talking about the Python documentation? -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis Men live by forgetting -- women live on memori

Re: Python docs [was: function with a state]

2005-03-24 Thread Terry Reedy
>Comparisons can be chained, and is evaluated from left to right. For >example, x < y <= z is equivalent to (x < y) <= z. The proposed 'correction' above is incorrect and should be ignored. >>> x,y,z = 2,3,1 >>> x>> (xhttp://mail.python.org/mailman/listinfo/python-list

Re: Python docs [was: function with a state]

2005-03-24 Thread Michael Spencer
Paul L. Du Bois wrote: Xah Lee wrote: I think i'll just post... [ snipped ] That is a very good analysis. Can you submit a documentation patch? I would, but I'm too lazy to contribute. That doesn't mean I'm not thankful for your efforts, though! p Or if not a doc patch, how about a limerick? M

Re: Python docs [was: function with a state]

2005-03-24 Thread Paul L. Du Bois
Xah Lee wrote: > I think i'll just post snippets of my comments as i find them. (and > feel like exposing) > [ snipped ] That is a very good analysis. Can you submit a documentation patch? I would, but I'm too lazy to contribute. That doesn't mean I'm not thankful for your efforts, though! p

Re: Python docs [was: function with a state]

2005-03-24 Thread Martin Ambuhl
Xah Lee wrote: The Python doc is relatively lousy, from content organization to the tech writing quality. I think i'll just post snippets of my comments as i find them. (and feel like exposing) The cross-posting idiot is back. Next he'll be posting his readings from Richard Burton's _Arabian Nigh

Re: Python docs [was: function with a state]

2005-03-24 Thread Xah Lee
The Python doc is relatively lousy, from content organization to the tech writing quality. I think i'll just post snippets of my comments as i find them. (and feel like exposing) Python doc: http://python.org/doc/2.4/lib/comparisons.html Quote: Comparison operations are supported by all objects.

Re: Python docs [was: function with a state]

2005-03-10 Thread Patrick Useldinger
You don't understand the "global" statement in Python, but you do understand Software industry in general? Smart... -- http://mail.python.org/mailman/listinfo/python-list

Re: function with a state

2005-03-09 Thread Dan Bishop
[EMAIL PROTECTED] wrote: > Xah Lee <[EMAIL PROTECTED]> wrote: > > > is it possible in Python to create a function that maintains a > > variable value? > > Yes. There's no concept of a 'static' function variable as such, but > there are many other ways to achieve the same thing. > > > globe=0; > > d

Re: function with a state

2005-03-09 Thread Xah Lee
Nevermind. I was thinking too much. :) Thanks. Xah Peter Hansen wrote: > Xah Lee wrote: > >>def myFun(var): > >> return var+1 > >>globe = 0 > >>globe = myFun(globe) > > > > this is intriguing. How does it work? > > not a rhetorical question, but where in the python doc can i read about > > it

Re: function with a state

2005-03-08 Thread Peter Hansen
Xah Lee wrote: def myFun(var): return var+1 globe = 0 globe = myFun(globe) this is intriguing. How does it work? not a rhetorical question, but where in the python doc can i read about it? The tutorial, presumably, since there is nothing here that isn't covered by the most basic aspects of Python

Re: function with a state

2005-03-08 Thread Xah Lee
>def myFun(var): > return var+1 >globe = 0 >globe = myFun(globe) this is intriguing. How does it work? not a rhetorical question, but where in the python doc can i read about it? thanks. Xah [EMAIL PROTECTED] http://xahlee.org/PageTwo_dir/more.html -- http://mail.python.org/mailman/listi

Re: Python docs [was: function with a state]

2005-03-08 Thread Steve Holden
Xah Lee wrote: thanks for the help... --- the python doc is stilted. It tried to organized the thing and with a style around some highbrow inane "computer science" outlook. [usual semi-literate expletive-deleted rant omitted] And your writing is so lucid and comprehensible, it's a pity you can

Re: Python docs [was: function with a state]

2005-03-08 Thread Sean Blakey
On 8 Mar 2005 17:07:31 -0800, Xah Lee <[EMAIL PROTECTED]> wrote: > thanks for the help... > > --- > the python doc is stilted. It tried to organized the thing and with a > style around some highbrow inane "computer science" outlook. > > i found the little section on global > (http://python.or

Python docs [was: function with a state]

2005-03-08 Thread Xah Lee
thanks for the help... --- the python doc is stilted. It tried to organized the thing and with a style around some highbrow inane "computer science" outlook. i found the little section on global (http://python.org/doc/2.4/ref/global.html) and can't make out what shit it is trying to say with

Re: function with a state

2005-03-07 Thread Reinhold Birkenfeld
Reinhold Birkenfeld wrote: > or with a default function argument: > > > class Dummy: pass > > def myFun(globe=Dummy()): > try:globe.globe += 1 > except: globe.globe = 1 > > return globe.globe A quicker way: def myFun(globe=[0]): globe[0] += 1 return globe[0] Reinhold

Re: function with a state

2005-03-06 Thread Stephen Thorne
On Sun, 06 Mar 2005 09:44:41 +0100, Patrick Useldinger <[EMAIL PROTECTED]> wrote: > Xah Lee wrote: > > > globe=0; > > def myFun(): > > globe=globe+1 > > return globe > > The short answer is to use the global statement: > > globe=0 > def myFun(): >global globe >globe=globe+1 >retu

Re: function with a state

2005-03-06 Thread Mike Meyer
"Xah Lee" <[EMAIL PROTECTED]> writes: > the Python doc is quite stilted. Where in the python doc is a programer > supposed read about how the package/module system in Python works? > (besides the tutorial that touches it) The python docs at http://docs.python.org/ref/naming.html > are perfectly c

Re: function with a state

2005-03-06 Thread Kent Johnson
Patrick Useldinger wrote: Kent Johnson wrote: globe=0 globe=myfun(globe) def myFun(var): return var+1 This mystifies me. What is myfun()? What is var intended to be? myfun is an error ;-) should be myFun, of course. var is parameter of function myFun. If you call myFun with variable globe, all

Re: function with a state

2005-03-06 Thread Patrick Useldinger
Kent Johnson wrote: globe=0 globe=myfun(globe) def myFun(var): return var+1 This mystifies me. What is myfun()? What is var intended to be? myfun is an error ;-) should be myFun, of course. var is parameter of function myFun. If you call myFun with variable globe, all references to var will be

Re: function with a state

2005-03-06 Thread gene . tani
I believe python docs are quite *un*-stilted. Modules and packages are not complicated. Read chapter 7 of the nutshell, it's only 10 pages long. 2.3 and 2.4 didn't introduce any fundamental changes in how modules work AFAIK -- http://mail.python.org/mailman/listinfo/python-list

Re: function with a state

2005-03-06 Thread Andrew Koenig
"Xah Lee" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > globe=0; > def myFun(): > globe=globe+1 > return globe > > apparently it can't be done like that. I thought it can probably be > done by prefixing the variable with some package context... You can do this: globe=0

Re: function with a state

2005-03-06 Thread Reinhold Birkenfeld
Xah Lee wrote: > is it possible in Python to create a function that maintains a variable > value? > > something like this: > > globe=0; > def myFun(): > globe=globe+1 > return globe You could work with function attributes: def myFun(): try:myFun.globe += 1 except: myFun.globe =

Re: function with a state

2005-03-06 Thread gene . tani
and make it a singleton, viz: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52558 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66531 http://www.python.org/2.2.3/descrintro.html (scroll wayyy down) -- http://mail.python.org/mailman/listinfo/python-list

Re: function with a state

2005-03-06 Thread Kent Johnson
Patrick Useldinger wrote: The short answer is to use the global statement: globe=0 def myFun(): global globe globe=globe+1 return globe more elegant is: globe=0 globe=myfun(globe) def myFun(var): return var+1 This mystifies me. What is myfun()? What is var intended to be? Kent -- http://mai

Re: function with a state

2005-03-06 Thread and-google
Xah Lee <[EMAIL PROTECTED]> wrote: > is it possible in Python to create a function that maintains a > variable value? Yes. There's no concept of a 'static' function variable as such, but there are many other ways to achieve the same thing. > globe=0; > def myFun(): > globe=globe+1 > return g

Re: function with a state

2005-03-06 Thread Patrick Useldinger
Xah Lee wrote: globe=0; def myFun(): globe=globe+1 return globe The short answer is to use the global statement: globe=0 def myFun(): global globe globe=globe+1 return globe more elegant is: globe=0 globe=myfun(globe) def myFun(var): return var+1 and still more elegant is using classes

function with a state

2005-03-06 Thread Xah Lee
is it possible in Python to create a function that maintains a variable value? something like this: globe=0; def myFun(): globe=globe+1 return globe apparently it can't be done like that. I thought it can probably be done by prefixing the variable with some package context... the Python doc