Re: Assignment Versus Equality

2016-06-30 Thread Marko Rauhamaa
Gregory Ewing : > All your experiment shows is that the last information we had about > the magnet is that it was nearly stationary just above the horizon. > > It doesn't prove that the probe itself is frozen, any more than the > fact that a photograph you took of

Re: Assignment Versus Equality

2016-06-29 Thread Steven D'Aprano
On Thu, 30 Jun 2016 10:29 am, Gregory Ewing wrote: > All your experiment shows is that the last information we had > about the magnet is that it was nearly stationary just above > the horizon. > > It doesn't prove that the probe itself is frozen, any more than > the fact that a photograph you

Re: Assignment Versus Equality

2016-06-29 Thread Gregory Ewing
Marko Rauhamaa wrote: -- / \ / (almost) \ N |black || | hole |S \/ \ / -- / / compass needle / The compass needle shows that the probe is "frozen" and

Re: Assignment Versus Equality

2016-06-29 Thread BartC
On 29/06/2016 14:35, Chris Angelico wrote: On Wed, Jun 29, 2016 at 11:24 PM, BartC wrote: I used this little benchmark: def fn(): n=0 for i in range(100): n+=i for k in range(100): fn() Add, up the top: try: range = xrange except NameError: pass

Re: Assignment Versus Equality

2016-06-29 Thread Chris Angelico
On Wed, Jun 29, 2016 at 10:36 PM, Steven D'Aprano wrote: >> rosuav@sikorsky:~$ python2.7 -m timeit -s "n = 0" "for i in >> xrange(1): n += i" >> 1 loops, best of 3: 192 usec per loop >> rosuav@sikorsky:~$ python2.7 -m timeit -s "n = 1<<100" "for i in >> xrange(1):

Re: Assignment Versus Equality

2016-06-29 Thread Chris Angelico
On Wed, Jun 29, 2016 at 11:24 PM, BartC wrote: > I used this little benchmark: > > def fn(): > n=0 > for i in range(100): > n+=i > > for k in range(100): > fn() Add, up the top: try: range = xrange except NameError: pass Otherwise, your Py2 tests are

Re: Assignment Versus Equality

2016-06-29 Thread BartC
On 29/06/2016 13:36, Steven D'Aprano wrote: On Wed, 29 Jun 2016 06:09 pm, Chris Angelico wrote: That's not necessarily fair - you're comparing two quite different Python interpreters, so there might be something entirely different that counteracts the integer performance. No, my test

Re: Assignment Versus Equality

2016-06-29 Thread Steven D'Aprano
On Wed, 29 Jun 2016 06:09 pm, Chris Angelico wrote: > On Wed, Jun 29, 2016 at 4:45 PM, Steven D'Aprano > wrote: >> On Wednesday 29 June 2016 15:51, Lawrence D’Oliveiro wrote: >> >>> On Wednesday, June 29, 2016 at 5:26:46 PM UTC+12, Steven D'Aprano wrote:

Re: Assignment Versus Equality

2016-06-29 Thread Rustom Mody
On Wednesday, June 29, 2016 at 8:06:10 AM UTC+5:30, Steven D'Aprano wrote: > On Tue, 28 Jun 2016 12:10 am, Rustom Mody wrote: > > > Analogy: Python's bool as 1½-class because bool came into python a good > > decade after python and breaking old code is a bigger issue than fixing > > control

Re: Assignment Versus Equality

2016-06-29 Thread BartC
On 29/06/2016 10:56, Lawrence D’Oliveiro wrote: On Wednesday, June 29, 2016 at 9:49:23 PM UTC+12, BartC wrote: Even if Python has extremely efficient string handling, we know that low-level string ops normally take longer than low-level integer ops. Maybe part of the general principle that,

Re: Assignment Versus Equality

2016-06-29 Thread Lawrence D’Oliveiro
On Wednesday, June 29, 2016 at 9:49:23 PM UTC+12, BartC wrote: > Even if Python has extremely efficient string handling, we know that > low-level string ops normally take longer than low-level integer ops. Maybe part of the general principle that, on modern machines, memory is cheap, but

Re: Assignment Versus Equality

2016-06-29 Thread BartC
On 29/06/2016 06:26, Steven D'Aprano wrote: BUT in Python 3, the distinction between int and long is gone by dropping int and renaming long as "int". So all Python ints are BIGNUMs. In principle Python might use native 32 or 64 bit ints for small values and secretly promote them to BIGNUMs

Re: Assignment Versus Equality

2016-06-29 Thread Lawrence D’Oliveiro
On Wednesday, June 29, 2016 at 6:46:04 PM UTC+12, Steven D'Aprano wrote: > On Wednesday 29 June 2016 15:51, Lawrence D’Oliveiro wrote: > >> On Wednesday, June 29, 2016 at 5:26:46 PM UTC+12, Steven D'Aprano wrote: >>> BUT in Python 3, the distinction between int and long is gone by dropping >>>

Re: Assignment Versus Equality

2016-06-29 Thread Chris Angelico
On Wed, Jun 29, 2016 at 4:45 PM, Steven D'Aprano wrote: > On Wednesday 29 June 2016 15:51, Lawrence D’Oliveiro wrote: > >> On Wednesday, June 29, 2016 at 5:26:46 PM UTC+12, Steven D'Aprano wrote: >>> BUT in Python 3, the distinction between int and long is

Re: Assignment Versus Equality

2016-06-29 Thread Steven D'Aprano
On Wednesday 29 June 2016 15:51, Lawrence D’Oliveiro wrote: > On Wednesday, June 29, 2016 at 5:26:46 PM UTC+12, Steven D'Aprano wrote: >> BUT in Python 3, the distinction between int and long is gone by dropping >> int and renaming long as "int". So all Python ints are BIGNUMs. > > I don’t

Re: Assignment Versus Equality

2016-06-29 Thread Rustom Mody
On Wednesday, June 29, 2016 at 12:03:30 PM UTC+5:30, Rustom Mody wrote: > On Wednesday, June 29, 2016 at 11:57:03 AM UTC+5:30, Chris Angelico wrote: > > On Wed, Jun 29, 2016 at 3:55 PM, Rustom Mody wrote: > > >> The transparent shift from machine-word to bignum is what no longer > > >> exists.

Re: Assignment Versus Equality

2016-06-29 Thread Rustom Mody
On Wednesday, June 29, 2016 at 11:57:03 AM UTC+5:30, Chris Angelico wrote: > On Wed, Jun 29, 2016 at 3:55 PM, Rustom Mody wrote: > >> The transparent shift from machine-word to bignum is what no longer > >> exists. Both Py2 and Py3 will store large integers as bignums; Py2 has > >> two separate

Re: Assignment Versus Equality

2016-06-29 Thread Chris Angelico
On Wed, Jun 29, 2016 at 3:55 PM, Rustom Mody wrote: >> The transparent shift from machine-word to bignum is what no longer >> exists. Both Py2 and Py3 will store large integers as bignums; Py2 has >> two separate data types (int and long), with ints generally >>

Re: Assignment Versus Equality

2016-06-29 Thread Rustom Mody
On Wednesday, June 29, 2016 at 10:37:25 AM UTC+5:30, Chris Angelico wrote: > On Wed, Jun 29, 2016 at 2:51 PM, Lawrence D’Oliveiro wrote: > > On Wednesday, June 29, 2016 at 4:20:24 PM UTC+12, Chris Angelico wrote: > >>> https://www.jwz.org/blog/2010/10/every-day-i-learn-something-new-and-stupid/ >

Re: Assignment Versus Equality

2016-06-28 Thread Lawrence D’Oliveiro
On Wednesday, June 29, 2016 at 5:26:46 PM UTC+12, Steven D'Aprano wrote: > BUT in Python 3, the distinction between int and long is gone by dropping > int and renaming long as "int". So all Python ints are BIGNUMs. I don’t understand what the problem is with this. Is there supposed to be some

Re: Assignment Versus Equality

2016-06-28 Thread Steven D'Aprano
On Wednesday 29 June 2016 14:51, Lawrence D’Oliveiro wrote: > On Wednesday, June 29, 2016 at 4:20:24 PM UTC+12, Chris Angelico wrote: >>> https://www.jwz.org/blog/2010/10/every-day-i-learn-something-new-and- stupid/ >> >> """It would also be reasonable to assume that any sane language >> runtime

Re: Assignment Versus Equality

2016-06-28 Thread Chris Angelico
On Wed, Jun 29, 2016 at 2:51 PM, Lawrence D’Oliveiro wrote: > On Wednesday, June 29, 2016 at 4:20:24 PM UTC+12, Chris Angelico wrote: >>> https://www.jwz.org/blog/2010/10/every-day-i-learn-something-new-and-stupid/ >> >> """It would also be reasonable to assume that any

Re: Assignment Versus Equality

2016-06-28 Thread Lawrence D’Oliveiro
On Wednesday, June 29, 2016 at 4:20:24 PM UTC+12, Chris Angelico wrote: >> https://www.jwz.org/blog/2010/10/every-day-i-learn-something-new-and-stupid/ > > """It would also be reasonable to assume that any sane language > runtime would have integers transparently degrade to BIGNUMs, making > the

Re: Assignment Versus Equality

2016-06-28 Thread Random832
On Tue, Jun 28, 2016, at 22:27, Steven D'Aprano wrote: > Are you suggesting that email clients and newsreaders should silently > mangle the text of your message behind your back? Because that's what > it sounds like you're saying. That was how I was characterizing Rustom Mody's position; he

Re: Assignment Versus Equality

2016-06-28 Thread Chris Angelico
On Wed, Jun 29, 2016 at 12:35 PM, Steven D'Aprano wrote: > > Whereas some decisions are just dumb: > > https://www.jwz.org/blog/2010/10/every-day-i-learn-something-new-and-stupid/ """It would also be reasonable to assume that any sane language runtime would have integers

Re: Assignment Versus Equality

2016-06-28 Thread Rustom Mody
On Wednesday, June 29, 2016 at 9:27:44 AM UTC+5:30, Rustom Mody wrote: > On Wednesday, June 29, 2016 at 7:58:04 AM UTC+5:30, Steven D'Aprano wrote: > > This is not a good idea. > [This is an experiment :-) ] Um... So now its working ie the offensive behavior (to me also) that Steven described is

Re: Assignment Versus Equality

2016-06-28 Thread Rustom Mody
On Wednesday, June 29, 2016 at 7:58:04 AM UTC+5:30, Steven D'Aprano wrote: > On Wed, 29 Jun 2016 12:13 am, Random832 wrote: > > > On Tue, Jun 28, 2016, at 00:31, Rustom Mody wrote: > >> GG downgrades posts containing unicode if it can, thereby increasing > >> reach to recipients with

Re: Assignment Versus Equality

2016-06-28 Thread Steven D'Aprano
On Tue, 28 Jun 2016 12:10 am, Rustom Mody wrote: > Analogy: Python's bool as 1½-class because bool came into python a good > decade after python and breaking old code is a bigger issue than fixing > control constructs to be bool-strict That analogy fails because Python bools being implemented as

Re: Assignment Versus Equality

2016-06-28 Thread Steven D'Aprano
On Wed, 29 Jun 2016 12:13 am, Random832 wrote: > On Tue, Jun 28, 2016, at 00:31, Rustom Mody wrote: >> GG downgrades posts containing unicode if it can, thereby increasing >> reach to recipients with unicode-broken clients > > That'd be entirely reasonable, except for the excessively broad >

Re: Assignment Versus Equality

2016-06-28 Thread Lawrence D’Oliveiro
On Tuesday, June 28, 2016 at 10:35:21 PM UTC+12, Chris Angelico wrote: > On Tue, Jun 28, 2016 at 6:49 PM, Lawrence D’Oliveiro wrote: > > On Tuesday, June 28, 2016 at 7:26:30 PM UTC+12, Chris Angelico wrote: >>> Why not: >>> >>> if (error) goto cleanup; >>> ... >>> cleanup: >>> do_cleanup; >> >>

Re: Assignment Versus Equality

2016-06-28 Thread Gene Heskett
On Tuesday 28 June 2016 15:40:48 Marko Rauhamaa wrote: > Ian Kelly : > > On Tue, Jun 28, 2016 at 10:39 AM, Marko Rauhamaa wrote: > >> Inside the probe, we have a powerful electrical magnet that our > >> compass can detect from a safe distance away. > >>

Re: Assignment Versus Equality

2016-06-28 Thread Marko Rauhamaa
Ian Kelly : > On Tue, Jun 28, 2016 at 10:39 AM, Marko Rauhamaa wrote: >> Inside the probe, we have a powerful electrical magnet that our >> compass can detect from a safe distance away. >> >> [...] >> >> The compass needle shows that the probe is "frozen"

Re: Assignment Versus Equality

2016-06-28 Thread Ian Kelly
On Tue, Jun 28, 2016 at 10:39 AM, Marko Rauhamaa wrote: > > (sorry for the premature previous post) > > Random832 : >> All objects, not just black holes, have those properties. The point >> here is that we are in fact observing those properties of an

Re: Assignment Versus Equality

2016-06-28 Thread Random832
On Tue, Jun 28, 2016, at 12:39, Marko Rauhamaa wrote: > A physicist once clarified to me that an almost-black-hole is > practically identical with a black hole because all information about > anything falling in is very quickly red-shifted to oblivion. Subject to some definition of "quickly" and

Re: Assignment Versus Equality

2016-06-28 Thread Marko Rauhamaa
Marko Rauhamaa : > (sorry for the premature previous post) Screw it! Wrong thread! Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: Assignment Versus Equality

2016-06-28 Thread Marko Rauhamaa
(sorry for the premature previous post) Random832 : > All objects, not just black holes, have those properties. The point > here is that we are in fact observing those properties of an object > that is not yet (and never will be) a black hole in our frame of > reference.

Re: Assignment Versus Equality

2016-06-28 Thread Random832
On Tue, Jun 28, 2016, at 00:31, Rustom Mody wrote: > GG downgrades posts containing unicode if it can, thereby increasing > reach to recipients with unicode-broken clients That'd be entirely reasonable, except for the excessively broad application of "if it can". Certainly it _can_ do it all the

Re: Assignment Versus Equality

2016-06-28 Thread BartC
On 28/06/2016 01:11, Dennis Lee Bieber wrote: On Tue, 28 Jun 2016 00:08:00 +0100, BartC declaimed the following: You just design the compiler to do the same processing in each case, ie. parse a followed (), then mark the result AST fragment as either an Array term, or

Re: Assignment Versus Equality

2016-06-28 Thread Chris Angelico
On Tue, Jun 28, 2016 at 6:49 PM, Lawrence D’Oliveiro wrote: > On Tuesday, June 28, 2016 at 7:26:30 PM UTC+12, Chris Angelico wrote: >> Why not: >> >> if (error) goto cleanup; >> ... >> cleanup: >> do_cleanup; > > They all fall into that same trap. Doesn’t scale. Try one

Re: Assignment Versus Equality

2016-06-28 Thread Lawrence D’Oliveiro
On Tuesday, June 28, 2016 at 7:26:30 PM UTC+12, Chris Angelico wrote: > Why not: > > if (error) goto cleanup; > ... > cleanup: > do_cleanup; They all fall into that same trap. Doesn’t scale. Try one with allocation inside a loop, e.g. lines 488 onwards. --

Re: Assignment Versus Equality

2016-06-28 Thread Jussi Piitulainen
Marko Rauhamaa writes: > Chris Angelico wrote: > >> Or Windows-1252, but declared as Latin-1. (Bane of my life.) > > J J [1] uses ASCII. References: [1] https://en.wikipedia.org/wiki/J_(programming_language) -- https://mail.python.org/mailman/listinfo/python-list

Re: Assignment Versus Equality

2016-06-28 Thread Chris Angelico
On Tue, Jun 28, 2016 at 5:12 PM, Lawrence D’Oliveiro wrote: > . do { /* once */ if (error) break; ... } while (false); do_cleanup; Why not: if (error) goto cleanup; ... cleanup: do_cleanup; Oh,

Re: Assignment Versus Equality

2016-06-28 Thread Lawrence D’Oliveiro
On Tuesday, June 28, 2016 at 6:14:28 PM UTC+12, Rustom Mody wrote: > Ive listed these spottinesses > See http://blog.languager.org/2015/03/whimsical-unicode.html > Specifically the section on ½-assed unicode support Remember how those UTF-16-using pieces of software got sucked into it. They were

Re: Assignment Versus Equality

2016-06-28 Thread Gregory Ewing
BartC wrote: On 27/06/2016 23:45, Lawrence D’Oliveiro wrote: FORMAT(...complex expression with lots of nested parentheses...) = You just design the compiler to do the same processing in each case, ie. parse a followed (), then mark the result AST fragment as either an Array term, or

Re: Assignment Versus Equality

2016-06-28 Thread Rustom Mody
On Tuesday, June 28, 2016 at 9:55:39 AM UTC+5:30, Marko Rauhamaa wrote: > sohcahtoa82: > > > On Monday, June 27, 2016 at 7:09:35 AM UTC-7, Marko Rauhamaa wrote: > >> Grant Edwards : > >> > Were there other languages that did something similar? > >> > >> In XML, whitespace between tags is

Re: Assignment Versus Equality

2016-06-28 Thread Gregory Ewing
Dennis Lee Bieber wrote: Or my favorite example of a parser headache: which is the loop instruction and which is the assignment DO10I=3,14 DO 10 I = 3.14 And if the programmer and/or compiler gets it wrong, your spacecraft crashes into the planet. -- Greg --

Re: Assignment Versus Equality

2016-06-28 Thread Rustom Mody
On Tuesday, June 28, 2016 at 11:12:59 AM UTC+5:30, Steven D'Aprano wrote: > On Tuesday 28 June 2016 14:31, Rustom Mody wrote: > > > On Tuesday, June 28, 2016 at 6:36:06 AM UTC+5:30, Steven D'Aprano wrote: > >> On Tue, 28 Jun 2016 12:23 am, Rustom Mody wrote: > >> > Also how is GG deliberately

Re: Assignment Versus Equality

2016-06-28 Thread Gregory Ewing
BartC wrote: You mean the rationale was based on saving keystrokes? Maybe disk space as well -- bytes were expensive in those days! -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Assignment Versus Equality

2016-06-28 Thread Marko Rauhamaa
Chris Angelico : > Or Windows-1252, but declared as Latin-1. (Bane of my life.) J Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: Assignment Versus Equality

2016-06-28 Thread Chris Angelico
On Tue, Jun 28, 2016 at 3:42 PM, Steven D'Aprano wrote: > And how does that encourage clients to support Unicode? It just enables > developers to tell themselves "It's just a few weirdos and foreigners who use > Unicode, ASCII [by which they mean Latin 1] is

Re: Assignment Versus Equality

2016-06-27 Thread Steven D'Aprano
On Tuesday 28 June 2016 14:31, Rustom Mody wrote: > On Tuesday, June 28, 2016 at 6:36:06 AM UTC+5:30, Steven D'Aprano wrote: >> On Tue, 28 Jun 2016 12:23 am, Rustom Mody wrote: >> > Also how is GG deliberately downgrading clear unicode content to be kind >> > to obsolete clients at recipient end

Re: Assignment Versus Equality

2016-06-27 Thread Rustom Mody
On Monday, June 27, 2016 at 8:19:05 PM UTC+5:30, Alain Ketterlin wrote: > Grant Edwards writes: > > Did the poor sod who wrote the compiler think it was a good idea? > > I don't know, but he has a good excuse: he was one of the first to ever > write a compiler (see

Re: Assignment Versus Equality

2016-06-27 Thread Rustom Mody
On Tuesday, June 28, 2016 at 6:36:06 AM UTC+5:30, Steven D'Aprano wrote: > On Tue, 28 Jun 2016 12:23 am, Rustom Mody wrote: > > Also how is GG deliberately downgrading clear unicode content to be kind > > to obsolete clients at recipient end different from python 2 → 3 making > > breaking changes

Re: Assignment Versus Equality

2016-06-27 Thread Marko Rauhamaa
sohcahto...@gmail.com: > On Monday, June 27, 2016 at 7:09:35 AM UTC-7, Marko Rauhamaa wrote: >> Grant Edwards : >> > Were there other languages that did something similar? >> >> In XML, whitespace between tags is significant unless the document type >> says otherwise.

Re: Assignment Versus Equality

2016-06-27 Thread Steven D'Aprano
On Mon, 27 Jun 2016 11:59 pm, Grant Edwards wrote: > On 2016-06-26, BartC wrote: > >> (Note, for those who don't know (old) Fortran, that spaces and tabs are >> not significant. So those dots are needed, otherwise "a eq b" would be >> parsed as "aeqb".) > > I've always been

Re: Assignment Versus Equality

2016-06-27 Thread Steven D'Aprano
On Tue, 28 Jun 2016 01:27 am, MRAB wrote: > On 2016-06-27 14:59, Grant Edwards wrote: >> On 2016-06-26, BartC wrote: >> >>> (Note, for those who don't know (old) Fortran, that spaces and tabs are >>> not significant. So those dots are needed, otherwise "a eq b" would be >>>

Re: Assignment Versus Equality

2016-06-27 Thread Lawrence D’Oliveiro
On Tuesday, June 28, 2016 at 2:23:16 AM UTC+12, Rustom Mody wrote: > python 2 → 3 making breaking changes but not going beyond ASCII lexemes? You do know Python 3 allows Unicode letters in identifiers, right? -- https://mail.python.org/mailman/listinfo/python-list

Re: Assignment Versus Equality

2016-06-27 Thread Steven D'Aprano
On Tue, 28 Jun 2016 12:23 am, Rustom Mody wrote: > On Monday, June 27, 2016 at 6:58:26 PM UTC+5:30, Steven D'Aprano wrote: >> On Mon, 27 Jun 2016 10:48 pm, Rustom Mody wrote: >> >> > PS Google Groups is wise enough to jump through hoops trying to encode >> > my message above as latin-1, then as

Re: Assignment Versus Equality

2016-06-27 Thread sohcahtoa82
On Monday, June 27, 2016 at 7:09:35 AM UTC-7, Marko Rauhamaa wrote: > Grant Edwards : > > > On 2016-06-26, BartC wrote: > > > >> (Note, for those who don't know (old) Fortran, that spaces and tabs > >> are not significant. So those dots are needed,

Re: Assignment Versus Equality

2016-06-27 Thread BartC
On 27/06/2016 23:45, Lawrence D’Oliveiro wrote: On Tuesday, June 28, 2016 at 3:27:40 AM UTC+12, MRAB wrote: On 2016-06-27 14:59, Grant Edwards wrote: Why would a language designer think it a good idea? It let you have identifiers like "grand total"; there was no need for camel case or

Re: Assignment Versus Equality

2016-06-27 Thread Lawrence D’Oliveiro
On Tuesday, June 28, 2016 at 3:27:40 AM UTC+12, MRAB wrote: > On 2016-06-27 14:59, Grant Edwards wrote: >> Why would a language designer think it a good idea? >> > It let you have identifiers like "grand total"; there was no need for > camel case or underscores to separate the parts of the name.

Re: Assignment Versus Equality

2016-06-27 Thread Lawrence D’Oliveiro
On Tuesday, June 28, 2016 at 3:27:40 AM UTC+12, MRAB wrote: > > On 2016-06-27 14:59, Grant Edwards wrote: >> >> Were there other languages that did something similar? >> > Algol 60 and Algog 68. Algol 68 was actually slightly different. There were two separate alphabets: one used for names of

Re: Assignment Versus Equality

2016-06-27 Thread Gene Heskett
On Monday 27 June 2016 09:28:00 Steven D'Aprano wrote: > On Mon, 27 Jun 2016 10:48 pm, Rustom Mody wrote: > > PS Google Groups is wise enough to jump through hoops trying to > > encode my message above as latin-1, then as Windows 1252 and only > > when that does not work as UTF-8 > > There is

Re: Assignment Versus Equality

2016-06-27 Thread Grant Edwards
On 2016-06-27, MRAB wrote: > On 2016-06-27 14:59, Grant Edwards wrote: >> On 2016-06-26, BartC wrote: >> >>> (Note, for those who don't know (old) Fortran, that spaces and tabs are >>> not significant. So those dots are needed, otherwise "a eq b"

Re: Assignment Versus Equality

2016-06-27 Thread MRAB
On 2016-06-27 14:59, Grant Edwards wrote: On 2016-06-26, BartC wrote: (Note, for those who don't know (old) Fortran, that spaces and tabs are not significant. So those dots are needed, otherwise "a eq b" would be parsed as "aeqb".) I've always been baffled by that. Were

Re: Assignment Versus Equality

2016-06-27 Thread Alain Ketterlin
Grant Edwards writes: > On 2016-06-26, BartC wrote: > >> (Note, for those who don't know (old) Fortran, that spaces and tabs are >> not significant. So those dots are needed, otherwise "a eq b" would be >> parsed as "aeqb".) > > I've always been

Re: Assignment Versus Equality

2016-06-27 Thread Rustom Mody
On Monday, June 27, 2016 at 6:58:26 PM UTC+5:30, Steven D'Aprano wrote: > On Mon, 27 Jun 2016 10:48 pm, Rustom Mody wrote: > > > PS Google Groups is wise enough to jump through hoops trying to encode my > > message above as latin-1, then as Windows 1252 and only when that does not > > work as

Re: Assignment Versus Equality

2016-06-27 Thread Rustom Mody
On Monday, June 27, 2016 at 7:30:05 PM UTC+5:30, Grant Edwards wrote: > On 2016-06-26, BartC > > (Note, for those who don't know (old) Fortran, that spaces and tabs are > > not significant. So those dots are needed, otherwise "a eq b" would be > > parsed as "aeqb".) > > I've always been

Re: Assignment Versus Equality

2016-06-27 Thread Marko Rauhamaa
Grant Edwards : > On 2016-06-26, BartC wrote: > >> (Note, for those who don't know (old) Fortran, that spaces and tabs >> are not significant. So those dots are needed, otherwise "a eq b" >> would be parsed as "aeqb".) > > I've always been baffled by

Re: Assignment Versus Equality

2016-06-27 Thread Marko Rauhamaa
Steven D'Aprano : > On Mon, 27 Jun 2016 10:48 pm, Rustom Mody wrote: > >> PS Google Groups is wise enough to jump through hoops trying to >> encode my message above as latin-1, then as Windows 1252 and only >> when that does not work as UTF-8 > > There is nothing admirable

Re: Assignment Versus Equality

2016-06-27 Thread Grant Edwards
On 2016-06-26, BartC wrote: > (Note, for those who don't know (old) Fortran, that spaces and tabs are > not significant. So those dots are needed, otherwise "a eq b" would be > parsed as "aeqb".) I've always been baffled by that. Were there other languages that did something

Re: Assignment Versus Equality

2016-06-27 Thread Steven D'Aprano
On Mon, 27 Jun 2016 10:48 pm, Rustom Mody wrote: > PS Google Groups is wise enough to jump through hoops trying to encode my > message above as latin-1, then as Windows 1252 and only when that does not > work as UTF-8 There is nothing admirable about GG (or any other newsreader or email client)

Re: Assignment Versus Equality

2016-06-27 Thread Rustom Mody
On Monday, June 27, 2016 at 5:53:07 PM UTC+5:30, Bob Gailer wrote: > On Jun 26, 2016 5:29 PM, "Michael Torrie" wrote: > > > > On 06/26/2016 12:47 PM, Christopher Reimer wrote: > > > Sounds like fun. Every aspiring programmer should write an interpreter > > for some language at least once in his

Re: Assignment Versus Equality

2016-06-27 Thread Bob Gailer
On Jun 26, 2016 5:29 PM, "Michael Torrie" wrote: > > On 06/26/2016 12:47 PM, Christopher Reimer wrote: > Sounds like fun. Every aspiring programmer should write an interpreter > for some language at least once in his life! In the mid 1970' s I helped maintain an installation

Re: Assignment Versus Equality

2016-06-26 Thread Gregory Ewing
Christopher Reimer wrote: How can you not use chained assignments? I thought Python was the art of the clever one-liners. :) No, Python is the art of writing clever one-liners using more than one line. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Assignment Versus Equality

2016-06-26 Thread Gregory Ewing
BartC wrote: I did a year of it in the 1970s. Looks funny in lower case though. It's interesting how our perceptions of such things change. Up until my second year of university, my only experiences of computing had all been in upper case. Then we got a lecturer who wrote all his Pascal on the

Re: Assignment Versus Equality

2016-06-26 Thread BartC
On 27/06/2016 00:22, Gregory Ewing wrote: BartC wrote: On 26/06/2016 08:36, Lawrence D’Oliveiro wrote: One of Python’s few mistakes was that it copied the C convention of using “=” for assignment and “==” for equality comparison. One of C's many mistakes. Unfortunately C has been very

Re: Assignment Versus Equality

2016-06-26 Thread Gregory Ewing
BartC wrote: On 26/06/2016 08:36, Lawrence D’Oliveiro wrote: One of Python’s few mistakes was that it copied the C convention of using “=” for assignment and “==” for equality comparison. One of C's many mistakes. Unfortunately C has been very influential. I'm not sure it's fair to call it

Re: Assignment Versus Equality

2016-06-26 Thread Michael Torrie
On 06/26/2016 12:47 PM, Christopher Reimer wrote: > I started writing a BASIC interpreter in Python. The rudimentary version > for 10 PRINT "HELLO, WORLD!" and 20 GOTO 10 ran well. The next version > to read each line into a tree structure left me feeling over my head. So > I got "Writing

Re: Assignment Versus Equality

2016-06-26 Thread Christopher Reimer
On 6/26/2016 8:41 AM, MRAB wrote: On 2016-06-26 11:48, BartC wrote: On 26/06/2016 08:36, Lawrence D’Oliveiro wrote: One of Python’s few mistakes was that it copied the C convention of using “=” for assignment and “==” for equality comparison. One of C's many mistakes. Unfortunately C has

Re: Assignment Versus Equality

2016-06-26 Thread Christopher Reimer
On 6/26/2016 6:21 AM, Steven D'Aprano wrote: On Sun, 26 Jun 2016 08:48 pm, BartC wrote: On 26/06/2016 08:36, Lawrence D’Oliveiro wrote: One of Python’s few mistakes was that it copied the C convention of using “=” for assignment and “==” for equality comparison. One of C's many mistakes.

Re: Assignment Versus Equality

2016-06-26 Thread Marko Rauhamaa
Dennis Lee Bieber : > It did... but I'm sure we'd have a revolt if Python comparison > operators looked like: > > a .eq. b > a .ne. b > a .gt. b .or. c .lt. d > a .le. b .and. c .ge. d Yuck, who'd ever want to look at an eyesore like that. In

Re: Assignment Versus Equality

2016-06-26 Thread BartC
On 26/06/2016 16:41, MRAB wrote: On 2016-06-26 11:48, BartC wrote: However, why couldn't Python have used "=" both for assignment, and for equality? Since I understand assignment ops can't appear in expressions. [snip] Python supports chained assignments. For example, "a = b = 0" assigns 0

Re: Assignment Versus Equality

2016-06-26 Thread BartC
On 26/06/2016 16:47, Cousin Stanley wrote: Dennis Lee Bieber wrote: but I'm sure we'd have a revolt if Python comparison operators looked like: a .eq. b a .ne. b a .gt. b .or. c .lt. d a .le. b .and. c .ge. d As someone who learned fortran in the mid 1960s and pounded a lot

Re: Assignment Versus Equality

2016-06-26 Thread Cousin Stanley
Dennis Lee Bieber wrote: > > but I'm sure we'd have a revolt > if Python comparison operators looked like: > > a .eq. b > a .ne. b > a .gt. b .or. c .lt. d > a .le. b .and. c .ge. d > As someone who learned fortran in the mid 1960s and pounded a lot of fortran code in the

Re: Assignment Versus Equality

2016-06-26 Thread MRAB
On 2016-06-26 11:48, BartC wrote: On 26/06/2016 08:36, Lawrence D’Oliveiro wrote: One of Python’s few mistakes was that it copied the C convention of using “=” for assignment and “==” for equality comparison. One of C's many mistakes. Unfortunately C has been very influential. However, why

Re: Assignment Versus Equality

2016-06-26 Thread Rustom Mody
On Sunday, June 26, 2016 at 6:51:58 PM UTC+5:30, Steven D'Aprano wrote: > On Sun, 26 Jun 2016 08:48 pm, BartC wrote: > > > On 26/06/2016 08:36, Lawrence D’Oliveiro wrote: > >> One of Python’s few mistakes was that it copied the C convention of using > >> “=” for assignment and “==” for equality

Re: Assignment Versus Equality

2016-06-26 Thread Steven D'Aprano
On Sun, 26 Jun 2016 08:48 pm, BartC wrote: > On 26/06/2016 08:36, Lawrence D’Oliveiro wrote: >> One of Python’s few mistakes was that it copied the C convention of using >> “=” for assignment and “==” for equality comparison. > > One of C's many mistakes. Unfortunately C has been very

Re: Assignment Versus Equality

2016-06-26 Thread BartC
On 26/06/2016 08:36, Lawrence D’Oliveiro wrote: One of Python’s few mistakes was that it copied the C convention of using “=” for assignment and “==” for equality comparison. One of C's many mistakes. Unfortunately C has been very influential. However, why couldn't Python have used "=" both

Assignment Versus Equality

2016-06-26 Thread Lawrence D’Oliveiro
One of Python’s few mistakes was that it copied the C convention of using “=” for assignment and “==” for equality comparison. It should have copied the old convention from Algol-like languages (including Pascal), where “:=” was assignment, so “=” could keep a meaning closer to its