Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Gregory Ewing
Steven D'Aprano wrote: Why 78? Because it's one less than 79, as mandated by PEP 8, and two less than 80, the hoary old standard. There's another possible reason for the number 78, although hopefully it doesn't still apply today. There's an application I work with that stores free text in dat

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Teemu Likonen
* 2011-07-18T10:54:40+10:00 * Steven D'Aprano wrote: > Back in 2007, a n00b calling himself "TheFlyingDutchman" who I am > *reasonably* sure was Rick decided to fork Python: > > http://mail.python.org/pipermail/python-list/2007-September/1127123.html I don't know if they are the same person but q

Re: Crazy what-if idea for function/method calling syntax

2011-07-17 Thread Steven D'Aprano
On Mon, 18 Jul 2011 08:54 am ΤΖΩΤΖΙΟΥ wrote: > Jumping in: > > What if a construct > >xx(*args1, **kwargs1)yy(*args2, **kwargs2) > > was interpreted as > > xxyy(*(args1+args2), **(kwargs1+kwargs2)) > > (Note: with **(kwargs1+kwargs2) I mean “put keyword arguments in the > order given”,

Re: Ordered list question

2011-07-17 Thread jyoung79
Thank you Chris, Dan and Thomas for your replies. I really appreciate your insight, and I will look into the information you have given me. Dan, I've never heard of a "treap" or "red-black tree", so I'll be interested to research these. Thomas, Thanks very much for giving me further knowledg

Re: Looking for general advice on complex program

2011-07-17 Thread Josh English
Chris, I got my solution working, at least on my local machine. I'm trying to bundle it for testing on location. I've thought about the server-client model and one day I may have the guts to tackle that, but I don't think it's this project. Sadly, I'm the type of guy who almost has to re-inve

Re: Crazy what-if idea for function/method calling syntax

2011-07-17 Thread Ian Kelly
2011/7/17 ΤΖΩΤΖΙΟΥ : > Jumping in: > > What if a construct > > xx(*args1, **kwargs1)yy(*args2, **kwargs2) > > was interpreted as > > xxyy(*(args1+args2), **(kwargs1+kwargs2)) > > (Note: with **(kwargs1+kwargs2) I mean "put keyword arguments in the > order given", since dicts can't be added) > >

Using argparse to call method in various Classes?

2011-07-17 Thread Victor Hooi
Hi, I'm attempting to use argparse to write a simple script to perform operations on various types of servers: manage_servers.py Operations are things like check, build, deploy, configure, verify etc. Types of server are just different types of inhouse servers we use. We have a generic ser

Re: Crazy what-if idea for function/method calling syntax

2011-07-17 Thread Cameron Simpson
On 17Jul2011 15:54, ΤΖΩΤΖΙΟΥ wrote: | What if a construct | |xx(*args1, **kwargs1)yy(*args2, **kwargs2) | | was interpreted as | | xxyy(*(args1+args2), **(kwargs1+kwargs2)) | | (Note: with **(kwargs1+kwargs2) I mean “put keyword arguments in the | order given”, since dicts can't be added

Re: a little parsing challenge ☺

2011-07-17 Thread rantingrick
On Jul 17, 2:47 am, Xah Lee wrote: > 2011-07-16 > > folks, this one will be interesting one. > > the problem is to write a script that can check a dir of text files > (and all subdirs) and reports if a file has any mismatched matching > brackets. > >[...] > > • You script must be standalone. Must

Argparse, and linking to methods in Subclasses

2011-07-17 Thread Victor Hooi
Hi, I have a simple Python script to perform operations on various types on in-house servers: manage_servers.py Operations are things like check, build, deploy, configure, verify etc. Types of server are just different types of inhouse servers we use. We have a generic server class, then s

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Ben Finney
Steven D'Aprano writes: > The exception is, you have an indented block of code, perhaps three or four > indents deep (surely you never allow anything to get beyond five or six > indents?), and you want to raise an exception: > > raise SomeExceptionType("and here's a rather long er

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.17 07:54 PM, Steven D'Aprano wrote: > Then in 2010, Rick promised that if the Python developers didn't bow > to his demands, he would folk Python, and the silent majority who > agreed with him but were too terrified to say so publicly w

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Steven D'Aprano
Steven D'Aprano wrote: > Roy Smith wrote: > >> We don't have that problem any more. It truly boggles my mind that >> we're still churning out people with 80 column minds. I'm willing to >> entertain arguments about readability of long lines, but the idea that >> there's something magic about 80

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Mel
Andrew Berg wrote: > I should also mention that this mostly speculation on my part, and that > I would love to hear from someone who develops for these devices. There's a mailing list for Python scripting on Android -- List-Subscribe:

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Steven D'Aprano
Roy Smith wrote: > We don't have that problem any more. It truly boggles my mind that > we're still churning out people with 80 column minds. I'm willing to > entertain arguments about readability of long lines, but the idea that > there's something magic about 80 columns is hogwash. I agree! W

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Mel
Andrew Berg wrote: > I should also mention that this mostly speculation on my part, and that > I would love to hear from someone who develops for these devices. There's a mailing list for Python scripting on Android -- List-Subscribe:

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Steven D'Aprano
Chris Angelico wrote: > On Mon, Jul 18, 2011 at 2:53 AM, rantingrick > wrote: >> [a whole lot of guff] > > Rick, you need to: > > 1) Grab the Python source code > 2) Make your own version of Python that works the way you want it > 3) Call it something different > 4) Start your own mailing list.

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 I should also mention that this mostly speculation on my part, and that I would love to hear from someone who develops for these devices. - -- CPython 3.2.1 | Windows NT 6.1.7601.17592 | Thunderbird 5.0 PGP/GPG Public Key ID: 0xF88E034060A78FCB

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.17 07:28 PM, Roy Smith wrote: > Can you give me a more specific example? I assume there's nobody (at > least nobody sane) editing Python source code on iPhones. I haven't done it myself, but there are plenty of Python projects out the

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Roy Smith
In article , Andrew Berg wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: RIPEMD160 > > On 2011.07.17 06:29 PM, Roy Smith wrote: > > We don't have that problem any more. It truly boggles my mind that > > we're still churning out people with 80 column minds. I'm willing > > to entertain ar

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.17 06:29 PM, Roy Smith wrote: > We don't have that problem any more. It truly boggles my mind that > we're still churning out people with 80 column minds. I'm willing > to entertain arguments about readability of long lines, but the

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.17 11:46 AM, rantingrick wrote: > Why do you feel the need to layout your code in a "GUI-listview" > manner. Next you'll want column titles and column sorting... Jeez! > This is what you should have done... I was testing my psychic ab

Re: Crazy what-if idea for function/method calling syntax

2011-07-17 Thread Thomas Jollans
On 07/18/2011 12:54 AM, ΤΖΩΤΖΙΟΥ wrote: > Jumping in: > > What if a construct > >xx(*args1, **kwargs1)yy(*args2, **kwargs2) > > was interpreted as > > xxyy(*(args1+args2), **(kwargs1+kwargs2)) > > (Note: with **(kwargs1+kwargs2) I mean “put keyword arguments in the > order given”, since

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.17 03:12 PM, rantingrick wrote: > I can tell you one thing for sure. In MY version of Python everyone > will have a voice. That does not mean that EVERYONE will make the > final decision but EVERYONE's voice will be equally important.

Crazy what-if idea for function/method calling syntax

2011-07-17 Thread ΤΖΩΤΖΙΟΥ
Jumping in: What if a construct xx(*args1, **kwargs1)yy(*args2, **kwargs2) was interpreted as xxyy(*(args1+args2), **(kwargs1+kwargs2)) (Note: with **(kwargs1+kwargs2) I mean “put keyword arguments in the order given”, since dicts can't be added) This construct is currently a syntax erro

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Ian Kelly
On Sun, Jul 17, 2011 at 2:12 PM, rantingrick wrote: > On the face of it one might think vertical tabs are a good idea > however newlines work just fine. There is no reason for expanding > vertical whitespace to create readble code. If you can offer a good > reason i'm listening. Also be sure to po

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Cameron Simpson
On 17Jul2011 09:53, rantingrick wrote: | On Jul 17, 4:49 am, "Anders J. Munch" <2...@jmunch.dk> wrote: | > Originally, tabs were a navigation device: When you press the tab key, you skip | > ahead to the next tab column.  The notion that whitespace characters are | > inserted into the text would

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Gregory Ewing
Anders J. Munch wrote: > Cameron Simpson wrote: >> Personally, I like to use the tab _key_ as an input device, but to have >> my editor write real spaces to the file in consequence. Just like in the old days:) Most editors can be configured to do that. Where they fall down, in my experien

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Ian Kelly
On Sun, Jul 17, 2011 at 1:54 PM, rantingrick wrote: > On Jul 17, 1:48 pm, Ian Kelly wrote: > >> Let me get this straight.  You want us to use tabs so that individuals >> can set their tab width to however many spaces they want, but then you >> want everybody to set their tab widths to 4 spaces.  

Re: a little parsing challenge ☺

2011-07-17 Thread Thomas 'PointedEars' Lahn
Thomas 'PointedEars' Lahn wrote: > It is possible [to parse the parentheses language], with Perl-compatible > Regular Expressions (PCRE), provided that you have enough memory, to use > such an extended Regular Expression (not to be confused with EREs³)⁴: > > \((([^()]*|(?R))*)\) > > However, e

Re: a little parsing challenge ☺

2011-07-17 Thread Thomas Jollans
On 07/17/2011 10:16 PM, Thomas 'PointedEars' Lahn wrote: > Raymond Hettinger wrote: > >> Thomas 'PointedEars' Lahn wrote: >>> Did you notice the excessive crosspost? Please do not feed the troll. >> >> IMO, this was a legitimate cross post since it is for a multi-language >> programming challenge

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Dotan Cohen
On Sun, Jul 17, 2011 at 22:53, Thomas 'PointedEars' Lahn wrote: >> It simply isn't an issue. > > Apparently it is *has not been* an issue for *you* *yet*.  There are > languages (like Python) that are compiled just-in-time.  Besides, neither an > IDE nor a compiler can (always) recognize that foo[

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread rantingrick
On Jul 17, 2:34 pm, Thorsten Kampe wrote: > Indentation alignment will (because you're using only spaces). Otherwise > it doesn't align (it can't), simply because of the "variable-width". > > For instance (in a variable-width font): > > if a == b: >     var123    = 22 >     varxyz456 = 333 >

Re: a little parsing challenge ☺

2011-07-17 Thread Thomas 'PointedEars' Lahn
Raymond Hettinger wrote: > Thomas 'PointedEars' Lahn wrote: >> Did you notice the excessive crosspost? Please do not feed the troll. > > IMO, this was a legitimate cross post since it is for a multi-language > programming challenge and everyone can learn from comparing the > results. Even if so

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread rantingrick
On Jul 17, 1:54 pm, Ian Kelly wrote: > On Sun, Jul 17, 2011 at 10:29 AM, rantingrick wrote: > > I hate  vertical white-space. I follow Python style guide suggestions, > > and then some! I hate when people insert spaces into code blocks and > > function/method bodies. If you feel a space must be i

Re: a little parsing challenge ☺

2011-07-17 Thread Raymond Hettinger
On Jul 17, 8:49 am, Thomas Boell wrote: > But why do you enumerate with start=1? Shouldn't you start with index 0? The problem specification says that the the char number should match the emacs goto-char function which is indexed from one, not from zero. This is testable by taking the output of

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread rantingrick
On Jul 17, 1:48 pm, Ian Kelly wrote: > Let me get this straight.  You want us to use tabs so that individuals > can set their tab width to however many spaces they want, but then you > want everybody to set their tab widths to 4 spaces.  You're > contradicting yourself here. In my mind people ar

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Thomas 'PointedEars' Lahn
Dotan Cohen wrote: > On Sun, Jul 17, 2011 at 15:53, Thomas 'PointedEars' Lahn >> […] I do not understand how you can consider using a non-fixed-width >> font in programming "a real pleasure" as many them show a lot of >> ambiguities in source code. Take for example the lowercase "l" (el) vs. >>

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread rantingrick
On Jul 17, 1:22 pm, Tim Chase wrote: > > Solution: STOP USING BROKEN TOOLS!!! > > Unbroken tools that do anything worthwhile are usually > complicated tools. > > Just pointing that out in case you missed the irony... You make a good point, albeit a very well know point. It's the same kind of poi

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Thomas 'PointedEars' Lahn
Anders J. Munch wrote: > Steven D'Aprano wrote: >> I can't fathom why 8 position tabs were *ever* the default, let alone >> why they are still the default. > > That's because they were not invented as a means for programmers to vary > indentation. > > Originally, tabs were a navigation device: W

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Waldek M.
>> I'm still looking for the perfect programming font. Suggestions >> welcomed. > > When you find it Dotan, let me know, I've been looking since the later > '70's. For me, it's Terminus* (from sourceforge). Br. Waldek [*] As long as you don't need anything but iso8859-1. -- http://mail.python.

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Dotan Cohen
On Sun, Jul 17, 2011 at 21:20, Thorsten Kampe wrote: >> The past is bickering over selfish personal freedoms, the future of is >> unity. > > And a tab is *exactly* four spaces. Not three. Not five. Not eight. For > you, for me, and for the rest of the world. Amen! > Four is the number thou shalt

Re: Ordered list question

2011-07-17 Thread Dan Stromberg
If you need "read everything, then sort once", then a dictionary (or collections.defaultdict if you require undefined's) and a single sort at the end is probably the way to go. If you truly need an ordered datastructure (because you're reading one element, using things sorted, reading another elem

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Dotan Cohen
On Sun, Jul 17, 2011 at 20:57, rantingrick wrote: > Such a system of rigorous formatting rules requires much less > interpreter logic. Python will be leaner and meaner. There won't be > any more arguing about how to format code. There will only be one way; > the correct way! Choose to follow it or

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Thorsten Kampe
* Dotan Cohen (Sun, 17 Jul 2011 22:20:15 +0300) > > On Sun, Jul 17, 2011 at 14:51, Thorsten Kampe > wrote: > > * Dotan Cohen (Sun, 17 Jul 2011 14:11:40 +0300) > >> So long as the indentation lines up (which it does, with tabs or > >> spaces) then I do not see any problem with variable-width. > >

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Dotan Cohen
On Sun, Jul 17, 2011 at 17:29, gene heskett wrote: >> I'm still looking for the perfect programming font. Suggestions >> welcomed. > > When you find it Dotan, let me know, I've been looking since the later > '70's. > Hey there Gene! Are you not on every mailing list on the internet old man?!? I

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Dotan Cohen
On Sun, Jul 17, 2011 at 15:53, Thomas 'PointedEars' Lahn wrote: >> I am also a recent spaces-to-tabs convert. One of the reasons is that >> I've discovered that programing in a non-fixed width font is a real >> pleasure, but the spaces are too narrow. Tabs alleviate that. > > Not using a fixed-wid

Re: a little parsing challenge ☺

2011-07-17 Thread Raymond Hettinger
On Jul 17, 7:15 am, Thomas 'PointedEars' Lahn wrote: > Did you notice the excessive crosspost?  Please do not feed the troll. IMO, this was a legitimate cross post since it is for a multi-language programming challenge and everyone can learn from comparing the results. Raymond -- http://mail.p

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread rantingrick
On Jul 17, 1:20 pm, Thorsten Kampe wrote: > > The past is bickering over selfish personal freedoms, the future of is > > unity. > > And a tab is *exactly* four spaces. Not three. Not five. Not eight. For > you, for me, and for the rest of the world. Amen! Not *exactly*. A tab is just a control

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Dotan Cohen
On Sun, Jul 17, 2011 at 14:51, Thorsten Kampe wrote: > * Dotan Cohen (Sun, 17 Jul 2011 14:11:40 +0300) >> So long as the indentation lines up (which it does, with tabs or >> spaces) then I do not see any problem with variable-width. > >> What are the counter-arguments? > > Alignment doesn't line u

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Thomas 'PointedEars' Lahn
Thorsten Kampe wrote: > * Thomas 'PointedEars' Lahn (Sun, 17 Jul 2011 14:35:15 +0200) >> Thorsten Kampe wrote: >> > * Andrew Berg (Sun, 17 Jul 2011 05:02:22 -0500) >> >> I still don't understand. Whitespace to the left of an assignment >> >> to signify an indent and whitespace around operators to

Re: Ordered list question

2011-07-17 Thread Thomas 'PointedEars' Lahn
jyoun...@kc.rr.com wrote: ^^ Something is missing there. > I'm currently working on a project where I'm looping through xml elements, > pulling the 'id' attribute (which will be coerced to a number) No, usually it won't. > as well as the element tag. That's element _type name_.

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Ian Kelly
On Sun, Jul 17, 2011 at 10:29 AM, rantingrick wrote: > I hate  vertical white-space. I follow Python style guide suggestions, > and then some! I hate when people insert spaces into code blocks and > function/method bodies. If you feel a space must be inserted then that > is a good clue you should

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Ian Kelly
On Sun, Jul 17, 2011 at 9:15 AM, rantingrick wrote: >>  I can write my code to 80 >> columns using 4-space tabs, but if somebody later tries to edit the >> file using 8-space tabs, their lines will be too long. > > THEIR LINES is the key words. A tab control is a tab control is a (you > guessed it

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Thorsten Kampe
* rantingrick (Sun, 17 Jul 2011 10:57:10 -0700 (PDT)) > Choose to follow it or die of exceptions; your choice. One of the best things I've read for a long time :-). > The past is bickering over selfish personal freedoms, the future of is > unity. And a tab is *exactly* four spaces. Not three. No

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Tim Chase
4) Tabs remove the need for complicated indention/detention tools. On 07/17/2011 10:15 AM, rantingrick wrote: On Jul 17, 2:32 am, Ian Kelly wrote: This. I used to think that tabs were better, for pretty much the reasons Rick outlined, but I've had enough problems with editors munging my tabs

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Chris Angelico
On Mon, Jul 18, 2011 at 3:57 AM, rantingrick wrote: > It's funny you mention this because i am creating a specification for > a Python 4000 fork that removes all ambiguities and multiplicity from > the language. Very soon i will be posting the spec for review within > this group. Maybe some of you

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread rantingrick
On Jul 17, 12:11 pm, Chris Angelico wrote: > On Mon, Jul 18, 2011 at 2:53 AM, rantingrick wrote: > > [a whole lot of guff] > > Rick, you need to: > > 1) Grab the Python source code > 2) Make your own version of Python that works the way you want it > 3) Call it something different > 4) Start your

Re: Proposal to extend PEP 257 (New Documentation String Spec)

2011-07-17 Thread rantingrick
On Jul 17, 6:11 am, Tim Chase wrote: > On 07/16/2011 10:10 PM, Steven D'Aprano wrote: > > > But I've never come across an email client that messes with > > attachments. Just send your code as an attached .py file and > > it's all good. > > However I'm on a couple mailing lists (e.g. lurking on Ope

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Chris Angelico
On Mon, Jul 18, 2011 at 2:53 AM, rantingrick wrote: > [a whole lot of guff] Rick, you need to: 1) Grab the Python source code 2) Make your own version of Python that works the way you want it 3) Call it something different 4) Start your own mailing list. Put your money - or, in this case, devel

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread rantingrick
On Jul 17, 4:49 am, "Anders J. Munch" <2...@jmunch.dk> wrote: > Originally, tabs were a navigation device: When you press the tab key, you > skip > ahead to the next tab column.  The notion that whitespace characters are > inserted into the text would have been very alien to someone using text >

Re: a little parsing challenge ☺

2011-07-17 Thread Robert Klemme
On 07/17/2011 06:01 PM, Robert Klemme wrote: On 07/17/2011 03:55 PM, mhenn wrote: Am 17.07.2011 15:20, schrieb Robert Klemme: On 07/17/2011 11:48 AM, Raymond Hettinger wrote: On Jul 17, 12:47 am, Xah Lee wrote: i hope you'll participate. Just post solution here. Thanks. http://pastebin.com/

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Chris Angelico
On Mon, Jul 18, 2011 at 2:29 AM, rantingrick wrote: > You guys should feel lucky i am not the BDFL, because i would cast > plagues of exceptions on your lazy butts! > BDFL = Benevolent Dictator For Life. Note that first word. ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread rantingrick
On Jul 17, 5:42 am, Thorsten Kampe wrote: > When I'm (consistently, of course) indenting code, I'm aligning it. When > I'm aligning code, I do this by indenting it, see for instance... > > firstvariable = 11 > variable      = 111 > > firstvariable = 22 > variable =      222 > > The second "=" and

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread rantingrick
On Jul 17, 2:35 am, Thorsten Kampe wrote: > * rantingrick (Sat, 16 Jul 2011 09:51:02 -0700 (PDT)) > > > 3) Tabs create freedom in the form of user controlled indention. > > > Indention width should be a choice of the reader NOT the author. We > > should never "code in" indention width; but that is

Re: Ordered list question

2011-07-17 Thread Chris Angelico
On Mon, Jul 18, 2011 at 2:28 AM, wrote: > My question is, does python have a similar way to do something like this? > I'm assuming the best way is to create a dictionary and then sort it by > the keys? > That would be one way to do it. If you know beforehand what the highest ID is, you could cre

Ordered list question

2011-07-17 Thread jyoung79
I'm currently working on a project where I'm looping through xml elements, pulling the 'id' attribute (which will be coerced to a number) as well as the element tag. I'm needing these elements in numerical order (from the id). Example xml might look like: There will be cases where element

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Corey Richardson
Excerpts from Thorsten Kampe's message of Sun Jul 17 11:10:57 -0400 2011: > The "perfect programming font" is just the one that looks so good that > you would also use it for writing email. Dejavu Sans Mono is pretty > good. Consolas looks also looks good but it is Windows only. > I use inconso

Re: a little parsing challenge ☺

2011-07-17 Thread Robert Klemme
On 07/17/2011 03:55 PM, mhenn wrote: Am 17.07.2011 15:20, schrieb Robert Klemme: On 07/17/2011 11:48 AM, Raymond Hettinger wrote: On Jul 17, 12:47 am, Xah Lee wrote: i hope you'll participate. Just post solution here. Thanks. http://pastebin.com/7hU20NNL Ruby solution: https://gist.githu

Re: a little parsing challenge ☺

2011-07-17 Thread Thomas Boell
On Sun, 17 Jul 2011 02:48:42 -0700 (PDT) Raymond Hettinger wrote: > On Jul 17, 12:47 am, Xah Lee wrote: > > i hope you'll participate. Just post solution here. Thanks. > > http://pastebin.com/7hU20NNL I'm new to Python. I think I'd have done it in a similar way (in any language). Your use of o

Re: a little parsing challenge ☺

2011-07-17 Thread Thomas Jollans
On Jul 17, 9:47 am, Xah Lee wrote: > 2011-07-16 > > folks, this one will be interesting one. > > the problem is to write a script that can check a dir of text files > (and all subdirs) and reports if a file has any mismatched matching > brackets. > > • The files will be utf-8 encoded (unix style l

HOT HOT HOT

2011-07-17 Thread SAHITHI
FOR GOOD JOBS SITES TO YOU http://goodjobssites.blogspot.com/ FOR HOT PHOTO&VIDEOS KATRINA KAIF RARE PHOTOS http://southactresstou.blogspot.com/2011/07/katrina-kaif-wallpapers.html

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread rantingrick
On Jul 17, 2:32 am, Ian Kelly wrote: > This.  I used to think that tabs were better, for pretty much the > reasons Rick outlined, but I've had enough problems with editors > munging my tabs that I eventually found it simpler in practice to just > go with the flow and use spaces. Solution: STOP U

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Thorsten Kampe
* gene heskett (Sun, 17 Jul 2011 10:29:03 -0400) > On Sunday, July 17, 2011 10:28:16 AM Dotan Cohen did opine: > > I'm still looking for the perfect programming font. Suggestions > > welcomed. > > When you find it Dotan, let me know, I've been looking since the later > '70's. The "perfect program

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Thorsten Kampe
* Thomas 'PointedEars' Lahn (Sun, 17 Jul 2011 14:35:15 +0200) > Thorsten Kampe wrote: > > * Andrew Berg (Sun, 17 Jul 2011 05:02:22 -0500) > >> I still don't understand. Whitespace to the left of an assignment > >> to signify an indent and whitespace around operators to align > >> values (in a multi

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread gene heskett
On Sunday, July 17, 2011 10:28:16 AM Dotan Cohen did opine: > On Sat, Jul 16, 2011 at 19:51, rantingrick wrote: > > -- > > Evidence: Tabs ARE superior! > > -- > > I am also a recent spaces-to-tabs co

Re: a little parsing challenge ☺

2011-07-17 Thread gene heskett
On Sunday, July 17, 2011 10:12:27 AM Xah Lee did opine: > 2011-07-16 > > folks, this one will be interesting one. > > the problem is to write a script that can check a dir of text files > (and all subdirs) and reports if a file has any mismatched matching > brackets. > > • The files will be utf

Re: a little parsing challenge ☺

2011-07-17 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > On Sun, Jul 17, 2011 at 5:47 PM, Xah Lee wrote: >> the problem is to write a script that can check a dir of text files >> (and all subdirs) and reports if a file has any mismatched matching >> brackets. > > I wonder will it be possible to code the whole thing as a single

Re: a little parsing challenge ☺

2011-07-17 Thread mhenn
Am 17.07.2011 15:20, schrieb Robert Klemme: > On 07/17/2011 11:48 AM, Raymond Hettinger wrote: >> On Jul 17, 12:47 am, Xah Lee wrote: >>> i hope you'll participate. Just post solution here. Thanks. >> >> http://pastebin.com/7hU20NNL > > Ruby solution: https://gist.github.com/1087583 I acutally d

Re: a little parsing challenge ☺

2011-07-17 Thread Robert Klemme
On 07/17/2011 11:48 AM, Raymond Hettinger wrote: On Jul 17, 12:47 am, Xah Lee wrote: i hope you'll participate. Just post solution here. Thanks. http://pastebin.com/7hU20NNL Ruby solution: https://gist.github.com/1087583 Kind regards robert -- http://mail.python.org/mailman/listinfo/pytho

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread TheSaint
Ian Kelly wrote: > but if somebody later tries to edit the > file using 8-space tabs I came across this and I like to put a note on top of the script to remember to modify it accordingly. -- http://mail.python.org/mailman/listinfo/python-list

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Thomas 'PointedEars' Lahn
Dotan Cohen wrote: > On Sat, Jul 16, 2011 at 19:51, rantingrick wrote: >> -- >> Evidence: Tabs ARE superior! >> -- > > I am also a recent spaces-to-tabs convert. One of the reasons is that > I've disc

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Thomas 'PointedEars' Lahn
Thorsten Kampe wrote: > * Andrew Berg (Sun, 17 Jul 2011 05:02:22 -0500) >> I still don't understand. Whitespace to the left of an assignment to >> signify an indent and whitespace around operators to align values (in >> a multi-line assignment) are not the same. > > When I'm (consistently, of cou

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Anders J. Munch
Steven D'Aprano wrote: > I can't fathom why 8 position tabs were *ever* the default, let alone why > they are still the default. That's because they were not invented as a means for programmers to vary indentation. Originally, tabs were a navigation device: When you press the tab key, you skip

Re: a little parsing challenge ☺

2011-07-17 Thread rusi
On Jul 17, 4:34 pm, Chris Angelico wrote: > On Sun, Jul 17, 2011 at 5:47 PM, Xah Lee wrote: > > the problem is to write a script that can check a dir of text files > > (and all subdirs) and reports if a file has any mismatched matching > > brackets. > > I wonder will it be possible to code the wh

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Thorsten Kampe
* Dotan Cohen (Sun, 17 Jul 2011 14:11:40 +0300) > So long as the indentation lines up (which it does, with tabs or > spaces) then I do not see any problem with variable-width. > What are the counter-arguments? Alignment doesn't line up. Thorsten -- http://mail.python.org/mailman/listinfo/python

Re: a little parsing challenge ☺

2011-07-17 Thread Chris Angelico
On Sun, Jul 17, 2011 at 5:47 PM, Xah Lee wrote: > the problem is to write a script that can check a dir of text files > (and all subdirs) and reports if a file has any mismatched matching > brackets. I wonder will it be possible to code the whole thing as a single regular expression... I'm pretty

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread rusi
On Jul 17, 4:11 pm, Dotan Cohen wrote: > On Sun, Jul 17, 2011 at 11:35, Andrew Berg wrote: > >> programing in a non-fixed width font is a real pleasure > > If you're masochistic, maybe. Do you find fixed-width fonts ugly? > > I don't find that fixed-width fonts are ugly, but variable-width fonts

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Dotan Cohen
On Sun, Jul 17, 2011 at 11:35, Andrew Berg wrote: >> programing in a non-fixed width font is a real pleasure > If you're masochistic, maybe. Do you find fixed-width fonts ugly? I don't find that fixed-width fonts are ugly, but variable-width fonts sure are more of a pleasure. And with code-colour

Re: Proposal to extend PEP 257 (New Documentation String Spec)

2011-07-17 Thread Tim Chase
On 07/16/2011 10:10 PM, Steven D'Aprano wrote: But I've never come across an email client that messes with attachments. Just send your code as an attached .py file and it's all good. However I'm on a couple mailing lists (e.g. lurking on OpenBSD) that strip all attachments... -tkc -- http

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Thorsten Kampe
* Andrew Berg (Sun, 17 Jul 2011 05:02:22 -0500) > > And if we work on a project together, we have to agree on formatting > > anyway, the indent size being the least important one. > How is indent size unimportant with regard to formatting? Take some code or yours and format it with three and with

Re: Code hosting services

2011-07-17 Thread Thomas Jollans
On 07/17/2011 12:08 PM, Ben Finney wrote: > Thomas Jollans writes: > >> Launchpad has a cross-project bug tracker. > > With which you can (so I'm told) interact with completely using email. > >> Launchpad also uses the excruciatingly slow (but distributed, and >> written-in-python) bzr for vers

Re: Code hosting services

2011-07-17 Thread Ben Finney
Thomas Jollans writes: > Launchpad has a cross-project bug tracker. With which you can (so I'm told) interact with completely using email. > Launchpad also uses the excruciatingly slow (but distributed, and > written-in-python) bzr for version control. Citation needed. While Git is the fastest

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.17 04:33 AM, Thorsten Kampe wrote: > Not everyone who doesn't agree on indent size actually cares enough > about indent size - especially in someone else's code. I'd say it's > probably rather the majority making this whole debate art

Re: a little parsing challenge ☺

2011-07-17 Thread Raymond Hettinger
On Jul 17, 12:47 am, Xah Lee wrote: > i hope you'll participate. Just post solution here. Thanks. http://pastebin.com/7hU20NNL Raymond -- http://mail.python.org/mailman/listinfo/python-list

Re: FULL TIME PYTHON DEVELOPER OPPORTUNITY IN CHICAGO, IL

2011-07-17 Thread Chris Withers
On 07/07/2011 21:48, Aimee Gerzofsky wrote: Python Developer Major financial clients is seeking a PythonDeveloper for a *full time position in Chicago, IL*. It's better to post this kind of thing to the python job board: http://www.python.org/community/jobs/howto/ cheers, Chris -- Simplist

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Thorsten Kampe
* Andrew Berg (Sun, 17 Jul 2011 03:36:31 -0500) > Not everyone agrees on how many spaces an indent should be (whether an > indent is a tab or a space-tab), which is a good reason to use tabs. Not everyone who doesn't agree on indent size actually cares enough about indent size - especially in som

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.17 02:56 AM, Thorsten Kampe wrote: > What is the difference between indentation and alignment? Well, > indentation works with tabs, alignment not. The use of spaces for indentation is as much of a hack as the use of tabs for alignment

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.17 03:15 AM, Dotan Cohen wrote: > programing in a non-fixed width font is a real pleasure If you're masochistic, maybe. Do you find fixed-width fonts ugly? I really would like to know why anyone would use a non-fixed-width font for prog

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Dotan Cohen
On Sat, Jul 16, 2011 at 19:51, rantingrick wrote: > -- >  Evidence: Tabs ARE superior! > -- I am also a recent spaces-to-tabs convert. One of the reasons is that I've discovered that programing in a no

  1   2   >