Re: [OT] spelling colour / color was Re: Toggle

2014-10-18 Thread giacomo boffi
duncan smith writes: > [...] It was the "top / bottom of the [TV] programme" that I didn't > immediately get, because I was thinking of a timeline running left > to right (perhaps rather than the script used by the presenters). is it just me that thinks of a timeline running from the wall behind

Re: Toggle

2014-10-13 Thread alister
On Mon, 13 Oct 2014 05:43:10 +1100, Chris Angelico wrote: > On Mon, Oct 13, 2014 at 5:38 AM, Tony the Tiger > wrote: >>> colour = 'red' if colour == 'blue' else 'blue' >> >> I call that a subtle bug that most likely will jump up and bite your >> behind when you least expect it. > > More generall

Re: Toggle

2014-10-12 Thread Chris Angelico
On Mon, Oct 13, 2014 at 5:38 AM, Tony the Tiger wrote: >> colour = 'red' if colour == 'blue' else 'blue' > > I call that a subtle bug that most likely will jump up and bite your > behind when you least expect it. More generally, I'd say that this is solving a (very) slightly different problem: it

Re: [OT] spelling colour / color was Re: Toggle

2014-10-11 Thread duncan smith
On 11/10/14 20:55, William Ray Wing wrote: > On Oct 11, 2014, at 3:20 PM, Dennis Lee Bieber wrote: > >> On Sat, 11 Oct 2014 16:26:43 +0100, duncan smith >> declaimed the following: >> >> >>> The media have their own quirks when it comes to English. The BBC >>> regularly use "top of" / "bottom of

Re: [OT] spelling colour / color was Re: Toggle

2014-10-11 Thread William Ray Wing
On Oct 11, 2014, at 3:20 PM, Dennis Lee Bieber wrote: > On Sat, 11 Oct 2014 16:26:43 +0100, duncan smith > declaimed the following: > > >> The media have their own quirks when it comes to English. The BBC >> regularly use "top of" / "bottom of" in the sense of "start of" / "end >> of", but I d

Re: [OT] spelling colour / color was Re: Toggle

2014-10-11 Thread Simon Ward
On 11 October 2014 10:37:51 BST, Christian Gollwitzer wrote: >I tend to agree that British English is the "correct" version for me, >since I'm European, though not British. > >The usage of -ise in verbs, however, is a newer attempt to set the >British English apart from the American: > >

Re: [OT] spelling colour / color was Re: Toggle

2014-10-11 Thread duncan smith
On 11/10/14 12:45, mm0fmf wrote: > On 11/10/2014 10:37, Christian Gollwitzer wrote: >> Being a non-native English speaker/writer, I myself stick to the >> recommendations of the Oxford dictionary. >> >> Christian > > But you do realise the Oxford dictionary is different to English usage > and

Re: [OT] spelling colour / color was Re: Toggle

2014-10-11 Thread mm0fmf
On 11/10/2014 10:37, Christian Gollwitzer wrote: Being a non-native English speaker/writer, I myself stick to the recommendations of the Oxford dictionary. Christian But you do realise the Oxford dictionary is different to English usage and is renowned for using what is known as Oxford s

Re: [OT] spelling colour / color was Re: Toggle

2014-10-11 Thread Chris Angelico
On Sat, Oct 11, 2014 at 9:33 PM, Marko Rauhamaa wrote: > I'm getting a new appreciation for Lisp's age-old "car" and "cdr". > > The scientists have done this international thing for centuries. Their > single-letter naming might be the secret of their glorious success. > > Obscure acronyms for the

Re: [OT] spelling colour / color was Re: Toggle

2014-10-11 Thread Marko Rauhamaa
Dennis Lee Bieber : > And then there is REXX... Which deliberately has both centre() and > center() in its standard library -- and they do the same thing... I'm getting a new appreciation for Lisp's age-old "car" and "cdr". The scientists have done this international thing for centuries. Their s

Re: [OT] spelling colour / color was Re: Toggle

2014-10-11 Thread Christian Gollwitzer
Am 10.10.14 22:05, schrieb alister: Would the French tolerate me using an alternative Variant (Canadian or Carribean)? I think not UK English as spoken in England is the definitive version. The clue is in the Name - English not American I tend to agree that British English is the "correct" ver

Re: [OT] spelling colour / color was Re: Toggle

2014-10-10 Thread alister
On Fri, 10 Oct 2014 22:01:58 +0300, Marko Rauhamaa wrote: > alister : > >> On Thu, 09 Oct 2014 23:48:36 +0300, Marko Rauhamaa wrote: >> >>> "-ize" is standard everywhere in the English-speaking world. >> >> Not in England! > > http://www.oxforddictionaries.com/definition/english/realize> > > Bo

Re: [OT] spelling colour / color was Re: Toggle

2014-10-10 Thread Marko Rauhamaa
alister : > On Thu, 09 Oct 2014 23:48:36 +0300, Marko Rauhamaa wrote: > >> "-ize" is standard everywhere in the English-speaking world. > > Not in England! http://www.oxforddictionaries.com/definition/english/realize> Both -ize and -ise are valid in England. >> why wouldn't you use American Eng

Re: [OT] spelling colour / color was Re: Toggle

2014-10-10 Thread Mark Lawrence
On 10/10/2014 15:46, Neil D. Cerutti wrote: On 10/9/2014 3:53 PM, Tim Delaney wrote: That would be a theatre programme vs a computer program. I try to stick with the current spelling style when modifying existing code - esp. for APIs. It's very annoying to have some methods use "z" and others "

Re: [OT] spelling colour / color was Re: Toggle

2014-10-10 Thread Mark Lawrence
On 09/10/2014 23:53, Terry Reedy wrote: Like it or not, Python uses American English. It is my understanding that this has been agreed to by a Dutch born dictator. The traitor should be shot, selling out his fellow Europeans to the North Americans indeed :) -- My fellow Pythonistas, ask

Re: [OT] spelling colour / color was Re: Toggle

2014-10-10 Thread alister
On Thu, 09 Oct 2014 23:48:36 +0300, Marko Rauhamaa wrote: > Tim Delaney : > >> It's very annoying to have some methods use "z" and others "s" in the >> same package. > > "-ize" is standard everywhere in the English-speaking world. Not in England! > > Americans insist on "analyze," "paralyze" a

Re: [OT] spelling colour / color was Re: Toggle

2014-10-10 Thread Neil D. Cerutti
On 10/9/2014 3:53 PM, Tim Delaney wrote: That would be a theatre programme vs a computer program. I try to stick with the current spelling style when modifying existing code - esp. for APIs. It's very annoying to have some methods use "z" and others "s" in the same package. So since I'm currentl

Re: Toggle

2014-10-10 Thread Chris Angelico
On Sat, Oct 11, 2014 at 1:28 AM, Rustom Mody wrote: >> If you dont find all this confusing, I am reminded of Schrödinger (or >> one of his ilk): > >> If you dont find Quantum physics confusing you've not begun to understand it > > Ok: Not Schrödinger but John Wheeler: > http://www.colorado.edu/phy

Re: Toggle

2014-10-10 Thread Rustom Mody
On Friday, October 10, 2014 7:54:33 PM UTC+5:30, Rustom Mody wrote: > More telling comments from Alex (same SO post) > 1. Both have mostly useless default implementations > 2. if you override __repr__, that's ALSO used for __str__, but not vice versa > 3. despite the words on the subject found in t

Re: Toggle

2014-10-10 Thread Rustom Mody
On Friday, October 10, 2014 12:48:20 PM UTC+5:30, Steven D'Aprano wrote: > Rustom Mody wrote: > > On Thursday, October 9, 2014 10:26:41 AM UTC+5:30, Steven D'Aprano wrote: > >> On Wed, 08 Oct 2014 19:34:30 -0700, Rustom Mody wrote: > >> Color.Red > >> print (Color.Red) > >> > Color.Red >

Re: Toggle

2014-10-10 Thread Antoon Pardon
Op 09-10-14 om 03:42 schreef Ben Finney: > Seymore4Head writes: > >> I want to toggle between color="Red" and color="Blue" > It's good to cultivate ongoing familiarity with the standard library > https://docs.python.org/3/library/itertools.html#itertools.cycle> > so that you can make use of wheels

Re: [OT] spelling colour / color was Re: Toggle

2014-10-10 Thread Chris Angelico
On Fri, Oct 10, 2014 at 9:51 PM, Marko Rauhamaa wrote: > Chris Angelico : > >> If Python ever grows a 'color' statement or keyword, then sure. >> Otherwise, it's just identifiers and data, which are international. > > Do you mean that the Python syntax should use American spellings, but > the Pyth

Re: [OT] spelling colour / color was Re: Toggle

2014-10-10 Thread Marko Rauhamaa
Chris Angelico : > If Python ever grows a 'color' statement or keyword, then sure. > Otherwise, it's just identifiers and data, which are international. Do you mean that the Python syntax should use American spellings, but the Python standard library could use words like "colour", "Farbe", "väri"

Re: [OT] spelling colour / color was Re: Toggle

2014-10-10 Thread Chris Angelico
On Fri, Oct 10, 2014 at 9:08 PM, Marko Rauhamaa wrote: > Steven D'Aprano : > >> Python is an international product, not American. > > And American English is the international software engineering language, > minority or not. > > The rest of us are using it; why should you not follow suit? If Pyt

Re: [OT] spelling colour / color was Re: Toggle

2014-10-10 Thread Marko Rauhamaa
Steven D'Aprano : > Python is an international product, not American. And American English is the international software engineering language, minority or not. The rest of us are using it; why should you not follow suit? Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: Toggle

2014-10-10 Thread Steven D'Aprano
Rustom Mody wrote: > On Thursday, October 9, 2014 10:26:41 AM UTC+5:30, Steven D'Aprano wrote: >> On Wed, 08 Oct 2014 19:34:30 -0700, Rustom Mody wrote: > >> Color.Red >> print (Color.Red) >> > Color.Red >> > # Not sure what to make of that distinction... > >> That's because the intera

Re: Toggle

2014-10-10 Thread Steven D'Aprano
Rustom Mody wrote: > In fact this: >> >>> Color.blue.toggle() >> >> >>> Color.blue.toggle().toggle() >> > > is a nice example of a pattern that is rarely seen: > OO syntax, functional (ie non-state-changing) semantics. You don't write much Python code, do you? *wink* It is not "rarely seen" i

Re: [OT] spelling colour / color was Re: Toggle

2014-10-10 Thread Steven D'Aprano
Terry Reedy wrote: > On 10/9/2014 1:43 PM, mm0fmf wrote: >> On 09/10/2014 02:29, Steven D'Aprano wrote: >>> Apart from the horrible spelling of colour :-) >> >> I've always spelt colour as "color" when programming and as "colour" >> when writing language including documentation about software. >

Re: [OT] spelling colour / color was Re: Toggle

2014-10-10 Thread Chris Angelico
On Fri, Oct 10, 2014 at 5:52 PM, Steven D'Aprano wrote: > "Normal" programmers spell words the same in code as they do outside of > code, e.g.: > > age > address > length There's a difference between identifiers and commands, though. I would expect, for instance, that a customer's add

Re: [OT] spelling colour / color was Re: Toggle

2014-10-09 Thread Steven D'Aprano
mm0fmf wrote: > On 09/10/2014 02:29, Steven D'Aprano wrote: >> Apart from the horrible spelling of colour :-) > > I've always spelt colour as "color" when programming and as "colour" > when writing language including documentation about software. > > colour in a programme doesn't seem right. "N

Re: [OT] spelling colour / color was Re: Toggle

2014-10-09 Thread Chris Angelico
On Fri, Oct 10, 2014 at 9:53 AM, Terry Reedy wrote: > >> colour in a programme doesn't seem right. > > Perhaps ironically, there are 52 uses of 'colour' in the stdlib, all but 4 > in idlelib, and most of those in one file. I just changed all except in the > one file. I agree, although I wouldn't

Re: [OT] spelling colour / color was Re: Toggle

2014-10-09 Thread Terry Reedy
On 10/9/2014 1:43 PM, mm0fmf wrote: On 09/10/2014 02:29, Steven D'Aprano wrote: Apart from the horrible spelling of colour :-) I've always spelt colour as "color" when programming and as "colour" when writing language including documentation about software. Like it or not, Python uses Americ

Re: Toggle

2014-10-09 Thread Terry Reedy
On 10/9/2014 8:42 AM, Rustom Mody wrote: On Thursday, October 9, 2014 1:21:49 PM UTC+5:30, Peter Otten wrote: Rustom Mody wrote: BTW is there some flag that can make them identical? No flag, but you can tweak that P: import sys sys.displayhook = print "foo" foo def f(): pass ... f()

Re: [OT] spelling colour / color was Re: Toggle

2014-10-09 Thread Marko Rauhamaa
Tim Delaney : > It's very annoying to have some methods use "z" and others "s" in the > same package. "-ize" is standard everywhere in the English-speaking world. Americans insist on "analyze," "paralyze" and "catalyze" but paradoxically also on "lyse". > So since I'm currently working for a US

Re: [OT] spelling colour / color was Re: Toggle

2014-10-09 Thread Tim Delaney
On 10 October 2014 05:24, duncan smith wrote: > On 09/10/14 18:43, mm0fmf wrote: > > On 09/10/2014 02:29, Steven D'Aprano wrote: > >> Apart from the horrible spelling of colour :-) > > > > I've always spelt colour as "color" when programming and as "colour" > > when writing language including doc

Re: [OT] spelling colour / color was Re: Toggle

2014-10-09 Thread duncan smith
On 09/10/14 18:43, mm0fmf wrote: > On 09/10/2014 02:29, Steven D'Aprano wrote: >> Apart from the horrible spelling of colour :-) > > I've always spelt colour as "color" when programming and as "colour" > when writing language including documentation about software. > > colour in a programme doesn

[OT] spelling colour / color was Re: Toggle

2014-10-09 Thread mm0fmf
On 09/10/2014 02:29, Steven D'Aprano wrote: Apart from the horrible spelling of colour :-) I've always spelt colour as "color" when programming and as "colour" when writing language including documentation about software. colour in a programme doesn't seem right. -- https://mail.python.org/

Re: Toggle

2014-10-09 Thread Rustom Mody
On Thursday, October 9, 2014 9:39:07 PM UTC+5:30, Ian wrote: > On Wed, Oct 8, 2014 at 8:34 PM, Rustom Mody wrote: > > On Thursday, October 9, 2014 7:12:41 AM UTC+5:30, Ben Finney wrote: > >> Seymore4Head writes: > >> > I want to toggle between color="Red" and color="Blue" > >> It's good to cultivat

Re: Toggle

2014-10-09 Thread Ian Kelly
On Wed, Oct 8, 2014 at 8:34 PM, Rustom Mody wrote: > On Thursday, October 9, 2014 7:12:41 AM UTC+5:30, Ben Finney wrote: >> Seymore4Head writes: > >> > I want to toggle between color="Red" and color="Blue" > >> It's good to cultivate ongoing familiarity with the standard library > > And language.

Re: Toggle

2014-10-09 Thread alister
On Thu, 09 Oct 2014 17:57:03 +1300, Gregory Ewing wrote: > Seymore4Head wrote: >> I want to toggle between color="Red" and color="Blue" > > toggle = {"Red": "Blue", "Blue": "Red"} > color = toggle[color] How about a simple colour = 'red' if colour == 'blue' else 'blue' -- The light at the e

Re: Toggle

2014-10-09 Thread Rustom Mody
On Thursday, October 9, 2014 1:21:49 PM UTC+5:30, Peter Otten wrote: > Rustom Mody wrote: > > BTW is there some flag that can make them identical? > No flag, but you can tweak that P: > >>> import sys > >>> sys.displayhook = print > >>> "foo" > foo > >>> def f(): pass > ... > >>> f() > None Yea

Re: Toggle

2014-10-09 Thread Peter Otten
Rustom Mody wrote: > On Thursday, October 9, 2014 10:26:41 AM UTC+5:30, Steven D'Aprano wrote: >> On Wed, 08 Oct 2014 19:34:30 -0700, Rustom Mody wrote: > >> Color.Red >> print (Color.Red) >> > Color.Red >> > # Not sure what to make of that distinction... > >> That's because the intera

Re: Toggle

2014-10-08 Thread Chris Angelico
On Thu, Oct 9, 2014 at 4:39 PM, Rustom Mody wrote: > On Thursday, October 9, 2014 10:26:41 AM UTC+5:30, Steven D'Aprano wrote: >> On Wed, 08 Oct 2014 19:34:30 -0700, Rustom Mody wrote: > >> Color.Red >> print (Color.Red) >> > Color.Red >> > # Not sure what to make of that distinction...

Re: Toggle

2014-10-08 Thread Rustom Mody
On Thursday, October 9, 2014 10:26:41 AM UTC+5:30, Steven D'Aprano wrote: > On Wed, 08 Oct 2014 19:34:30 -0700, Rustom Mody wrote: > Color.Red > print (Color.Red) > > Color.Red > > # Not sure what to make of that distinction... > That's because the interactive interpreter displays the r

Re: Toggle

2014-10-08 Thread Travis Griggs
On Oct 8, 2014, at 9:57 PM, Gregory Ewing wrote: > Seymore4Head wrote: >> I want to toggle between color="Red" and color="Blue" Don’t forget polymorphic dispatch… class Red(object): def toggle(self): return Blue() class Blue(object): def toggle(self): return Red() B

Re: Toggle

2014-10-08 Thread Gregory Ewing
Seymore4Head wrote: I want to toggle between color="Red" and color="Blue" toggle = {"Red": "Blue", "Blue": "Red"} color = toggle[color] -- https://mail.python.org/mailman/listinfo/python-list

Re: Toggle

2014-10-08 Thread Steven D'Aprano
On Wed, 08 Oct 2014 19:34:30 -0700, Rustom Mody wrote: Color.Red > print (Color.Red) > Color.Red > > # Not sure what to make of that distinction... That's because the interactive interpreter displays the repr() of objects (except for None, which it suppresses), while print outputs th

Re: Toggle

2014-10-08 Thread Chris Angelico
On Thu, Oct 9, 2014 at 2:54 PM, wrote: > On Wed, Oct 8, 2014, at 23:02, Mark Lawrence wrote: >> When I first read this I was extremely jealous of the originator but >> having used it umpteen times I'm still extremely jealous of the >> originator!!! Why doesn't my mind work like his? :) > > You c

Re: Toggle

2014-10-08 Thread random832
On Wed, Oct 8, 2014, at 23:02, Mark Lawrence wrote: > When I first read this I was extremely jealous of the originator but > having used it umpteen times I'm still extremely jealous of the > originator!!! Why doesn't my mind work like his? :) You could also keep the ints in two variables and do

Re: Toggle

2014-10-08 Thread Mark Lawrence
On 09/10/2014 02:25, Mark Lawrence wrote: On 09/10/2014 01:11, Seymore4Head wrote: I want to toggle between color="Red" and color="Blue" Here is one: if color == "Red": color = "Blue" else: color = "Red" Here is two: if x = "True" color = "Red" else: color="Blue" x= n

Re: Toggle

2014-10-08 Thread Rustom Mody
On Thursday, October 9, 2014 7:12:41 AM UTC+5:30, Ben Finney wrote: > Seymore4Head writes: > > I want to toggle between color="Red" and color="Blue" > It's good to cultivate ongoing familiarity with the standard library And language. In recent python3: >>> class Color(Enum): ... Red = 0 ...

Re: Toggle

2014-10-08 Thread Ben Finney
Seymore4Head writes: > I want to toggle between color="Red" and color="Blue" It's good to cultivate ongoing familiarity with the standard library https://docs.python.org/3/library/itertools.html#itertools.cycle> so that you can make use of wheels already invented and maintained:: import ite

Re: Toggle

2014-10-08 Thread Steven D'Aprano
Seymore4Head wrote: > I want to toggle between color="Red" and color="Blue" > Here is one: > if color == "Red": > color = "Blue" > else: > color = "Red" Apart from the horrible spelling of colour :-) that seems fine to me. You might wish to include a comment: # Assumes th

Re: Toggle

2014-10-08 Thread Mark Lawrence
On 09/10/2014 01:11, Seymore4Head wrote: I want to toggle between color="Red" and color="Blue" Here is one: if color == "Red": color = "Blue" else: color = "Red" Here is two: if x = "True" color = "Red" else: color="Blue" x= not x Others? Here http://stackoverflow.