Re: I'm searching for Python style guidelines

2008-01-10 Thread rui
Thanks Caleb. Really liked some points. On Jan 10, 2008 11:20 AM, Caleb <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > > Anything written somewhere that's thorough? Any code body that should > > serve as a reference? > > 1. Don't use tabs (use spaces). > 2. Study "import this" > 3. Use

Re: I'm searching for Python style guidelines

2008-01-10 Thread Caleb
[EMAIL PROTECTED] wrote: > Anything written somewhere that's thorough? Any code body that should > serve as a reference? 1. Don't use tabs (use spaces). 2. Study "import this" 3. Use lists and dictionaries as much as you possibly can 4. Use comprehensions and generators as much as you possibly ca

Re: I'm searching for Python style guidelines

2008-01-09 Thread MartinRinehart
Matthew Woodcraft wrote: > I think [the olpc guidlines are] mostly PEP 8, with some notes added. Took a good look. You are absolutely correct. PEP 8 is basically word processing text stuck between and tags. OLPC is Wiki HTML. Good example of how the latter is a lot bigger than the former, wit

Re: I'm searching for Python style guidelines

2008-01-08 Thread Matthew Woodcraft
<[EMAIL PROTECTED]> wrote: > A quick look (thorough analysis still required) shows that OLPC and > PyPy are, indeed, extensive standards. > one-laptop-per-child.html > (olpc),74.3,,http://wiki.laptop.org/go/Python_Style_Guide I think that's mostly PEP 8, with some notes added. -M- -- http://m

Re: I'm searching for Python style guidelines

2008-01-08 Thread Matthew Woodcraft
Paul McGuire <[EMAIL PROTECTED]> wrote: > While not required by any means, you will also find it handy to follow > *every* entry in the list with a comma, even the last one in the list > (this is legal Python). That is, in your example: > > foo =3D [ > 'too long', > 'too long too', >

Re: I'm searching for Python style guidelines

2008-01-08 Thread Neil Cerutti
On Jan 8, 2008 12:35 PM, Martin Vilcans <[EMAIL PROTECTED]> wrote: > On 1/7/08, Guilherme Polo <[EMAIL PROTECTED]> wrote: > > 2008/1/7, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > > Anything written somewhere that's thorough? Any code body that should > > > serve as a reference? > > > > PEP 8 > > ht

Re: I'm searching for Python style guidelines

2008-01-08 Thread Colin J. Williams
Martin Vilcans wrote: > On 1/7/08, Guilherme Polo <[EMAIL PROTECTED]> wrote: >> 2008/1/7, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: >>> Anything written somewhere that's thorough? Any code body that should >>> serve as a reference? >> PEP 8 >> http://www.python.org/dev/peps/pep-0008/ > > The problem

Re: I'm searching for Python style guidelines

2008-01-08 Thread Martin Vilcans
On 1/7/08, Guilherme Polo <[EMAIL PROTECTED]> wrote: > 2008/1/7, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > Anything written somewhere that's thorough? Any code body that should > > serve as a reference? > > PEP 8 > http://www.python.org/dev/peps/pep-0008/ The problem with PEP 8 is that even code

Re: I'm searching for Python style guidelines

2008-01-08 Thread MartinRinehart
That's a great list, grflanagan! Thanks. I looked at each and copied to my disk either as a .txt (cut/paste from the browser) for a page or less or as .html (view source, chop off head and non-guideline stuff, save). This is the list plus PEP 8 minus the software. (No disrespect for the software,

Re: I'm searching for Python style guidelines

2008-01-08 Thread grflanagan
On Jan 8, 3:08 am, ajaksu <[EMAIL PROTECTED]> wrote: > On Jan 7, 11:25 am, [EMAIL PROTECTED] wrote: > > > Anything written somewhere that's thorough? Any code body that should > > serve as a reference? > > I've done this search before and it was very interesting, doing it > again gave me new result

Re: I'm searching for Python style guidelines

2008-01-08 Thread Ben Finney
ajaksu <[EMAIL PROTECTED]> writes: > I've done this search before and it was very interesting, doing it > again gave me new results that also seem valuable. Here's most of > them (where PCG = Python Coding Guidelines). Thanks, this is an awesome list. It's good to have a variety of real examples

Re: I'm searching for Python style guidelines

2008-01-07 Thread ajaksu
On Jan 7, 11:25 am, [EMAIL PROTECTED] wrote: > There's a lot of dumb stuff out there. "Algorithms should be coded > efficiently ..." Thanks, I'll keep that in mind. > > van Rossum's guidelines tend toward "pick something and stick to it" > which is OK if you have enough experience to pick something

Re: I'm searching for Python style guidelines

2008-01-07 Thread Paul McGuire
On Jan 7, 12:26 pm, [EMAIL PROTECTED] wrote: > Guilherme Polo wrote: > > foo = [ > >     'too long', > >     'too long too', > >     ... > >     ] > > OK, I'll put it there too, and it will be easy for us to read each > other's code (at least in this particular). While not required by any means, y

Re: I'm searching for Python style guidelines

2008-01-07 Thread MartinRinehart
Guilherme Polo wrote: > foo = [ > 'too long', > 'too long too', > ... > ] OK, I'll put it there too, and it will be easy for us to read each other's code (at least in this particular). -- http://mail.python.org/mailman/listinfo/python-list

Re: I'm searching for Python style guidelines

2008-01-07 Thread Guilherme Polo
2008/1/7, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > Thank you both. > > Stupid me, went to Python.org and found Style Guidelines and thought > that was the last word. Oh well. > > PEP 8 reminds me a lot of Sun's Java conventions, in ways I wish it > didn't. The overall structure seems like a random

Re: I'm searching for Python style guidelines

2008-01-07 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Here's just one of my questions: > > foo = [ > 'some item, quite long', > 'more items, all demanding there own line as they are not short', > ... > > Where would you put the closing ']'? on a line by itself, indented as your favourite Python editor indents

Re: I'm searching for Python style guidelines

2008-01-07 Thread MartinRinehart
Thank you both. Stupid me, went to Python.org and found Style Guidelines and thought that was the last word. Oh well. PEP 8 reminds me a lot of Sun's Java conventions, in ways I wish it didn't. The overall structure seems like a random list of topics and it omits a lot. For Java I went from Sun t

Re: I'm searching for Python style guidelines

2008-01-07 Thread Peter Otten
MartinRinehart wrote: > Anything written somewhere that's thorough? Any code body that should > serve as a reference? http://www.python.org/dev/peps/pep-0008/ -- http://mail.python.org/mailman/listinfo/python-list

Re: I'm searching for Python style guidelines

2008-01-07 Thread Guilherme Polo
2008/1/7, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > There's a lot of dumb stuff out there. "Algorithms should be coded > efficiently ..." Thanks, I'll keep that in mind. > > van Rossum's guidelines tend toward "pick something and stick to it" > which is OK if you have enough experience to pick somet