Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #16993 > unrolled thread
| Started by | Eelco Hoogendoorn <hoogendoorn.eelco@gmail.com> |
|---|---|
| First post | 2011-12-12 00:44 +0100 |
| Last post | 2011-12-12 13:02 -0500 |
| Articles | 20 on this page of 91 — 21 participants |
Back to article view | Back to comp.lang.python
Verbose and flexible args and kwargs syntax Eelco Hoogendoorn <hoogendoorn.eelco@gmail.com> - 2011-12-12 00:44 +0100
Re: Verbose and flexible args and kwargs syntax Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-12-12 01:11 +0000
Re: Verbose and flexible args and kwargs syntax Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-12-12 21:09 +1300
Re: Verbose and flexible args and kwargs syntax Terry Reedy <tjreedy@udel.edu> - 2011-12-12 10:36 -0500
Re: Verbose and flexible args and kwargs syntax Nick Dokos <nicholas.dokos@hp.com> - 2011-12-12 10:55 -0500
Re: Verbose and flexible args and kwargs syntax Arnaud Delobelle <arnodel@gmail.com> - 2011-12-12 16:15 +0000
Re: Verbose and flexible args and kwargs syntax Chris Angelico <rosuav@gmail.com> - 2011-12-13 03:16 +1100
Re: Verbose and flexible args and kwargs syntax Chris Angelico <rosuav@gmail.com> - 2011-12-13 03:19 +1100
Re: Verbose and flexible args and kwargs syntax Eelco <hoogendoorn.eelco@gmail.com> - 2011-12-12 04:21 -0800
Re: Verbose and flexible args and kwargs syntax Ian Kelly <ian.g.kelly@gmail.com> - 2011-12-12 11:09 -0700
Re: Verbose and flexible args and kwargs syntax Eelco <hoogendoorn.eelco@gmail.com> - 2011-12-12 10:17 -0800
Re: Verbose and flexible args and kwargs syntax Ian Kelly <ian.g.kelly@gmail.com> - 2011-12-12 11:35 -0700
Re: Verbose and flexible args and kwargs syntax Eelco <hoogendoorn.eelco@gmail.com> - 2011-12-12 10:51 -0800
Re: Verbose and flexible args and kwargs syntax Ian Kelly <ian.g.kelly@gmail.com> - 2011-12-12 17:34 -0700
Re: Verbose and flexible args and kwargs syntax Eelco <hoogendoorn.eelco@gmail.com> - 2011-12-13 00:31 -0800
Re: Verbose and flexible args and kwargs syntax Eelco <hoogendoorn.eelco@gmail.com> - 2011-12-12 11:05 -0800
Re: Verbose and flexible args and kwargs syntax Eelco <hoogendoorn.eelco@gmail.com> - 2011-12-12 11:20 -0800
Re: Verbose and flexible args and kwargs syntax alex23 <wuwei23@gmail.com> - 2011-12-12 15:54 -0800
Re: Verbose and flexible args and kwargs syntax Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-12-13 02:43 +0000
Re: Verbose and flexible args and kwargs syntax Chris Angelico <rosuav@gmail.com> - 2011-12-13 14:08 +1100
Re: Verbose and flexible args and kwargs syntax Ian Kelly <ian.g.kelly@gmail.com> - 2011-12-12 21:52 -0700
Re: Verbose and flexible args and kwargs syntax Eelco <hoogendoorn.eelco@gmail.com> - 2011-12-13 01:15 -0800
Re: Verbose and flexible args and kwargs syntax Eelco <hoogendoorn.eelco@gmail.com> - 2011-12-13 01:50 -0800
Re: Verbose and flexible args and kwargs syntax Arnaud Delobelle <arnodel@gmail.com> - 2011-12-13 10:15 +0000
Re: Verbose and flexible args and kwargs syntax Eelco <hoogendoorn.eelco@gmail.com> - 2011-12-13 02:39 -0800
Re: Verbose and flexible args and kwargs syntax Eelco <hoogendoorn.eelco@gmail.com> - 2011-12-13 02:46 -0800
Re: Verbose and flexible args and kwargs syntax Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-12-13 11:28 +0000
Re: Verbose and flexible args and kwargs syntax Eelco <hoogendoorn.eelco@gmail.com> - 2011-12-13 04:19 -0800
Re: Verbose and flexible args and kwargs syntax Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-12-13 11:13 +0000
Re: Verbose and flexible args and kwargs syntax Eelco <hoogendoorn.eelco@gmail.com> - 2011-12-13 04:47 -0800
Re: Verbose and flexible args and kwargs syntax Chris Angelico <rosuav@gmail.com> - 2011-12-14 00:14 +1100
Re: Verbose and flexible args and kwargs syntax Eelco <hoogendoorn.eelco@gmail.com> - 2011-12-13 05:35 -0800
Re: Verbose and flexible args and kwargs syntax "OKB (not okblacke)" <brenNOSPAMbarn@NObrenSPAMbarn.net> - 2011-12-12 19:45 +0000
Re: Verbose and flexible args and kwargs syntax Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2011-12-12 12:59 +0200
Re: Verbose and flexible args and kwargs syntax Eelco <hoogendoorn.eelco@gmail.com> - 2011-12-12 03:22 -0800
Re: Verbose and flexible args and kwargs syntax Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2011-12-12 13:46 +0200
Re: Verbose and flexible args and kwargs syntax Eelco <hoogendoorn.eelco@gmail.com> - 2011-12-12 03:18 -0800
Re: Verbose and flexible args and kwargs syntax Terry Reedy <tjreedy@udel.edu> - 2011-12-12 10:39 -0500
Re: Verbose and flexible args and kwargs syntax Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2011-12-12 18:52 +0200
Re: Verbose and flexible args and kwargs syntax Eelco <hoogendoorn.eelco@gmail.com> - 2011-12-12 09:29 -0800
Re: Verbose and flexible args and kwargs syntax Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2011-12-12 20:09 +0200
% is not an operator [was Re: Verbose and flexible args and kwargs syntax] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-12-14 03:18 +0000
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Eelco <hoogendoorn.eelco@gmail.com> - 2011-12-13 23:49 -0800
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Arnaud Delobelle <arnodel@gmail.com> - 2011-12-14 11:55 +0000
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Eelco <hoogendoorn.eelco@gmail.com> - 2011-12-14 04:33 -0800
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Arnaud Delobelle <arnodel@gmail.com> - 2011-12-14 16:13 +0000
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Eelco <hoogendoorn.eelco@gmail.com> - 2011-12-14 09:15 -0800
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] rusi <rustompmody@gmail.com> - 2011-12-14 19:43 -0800
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Eelco <hoogendoorn.eelco@gmail.com> - 2011-12-15 01:44 -0800
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] rusi <rustompmody@gmail.com> - 2011-12-15 02:56 -0800
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Eelco <hoogendoorn.eelco@gmail.com> - 2011-12-15 03:37 -0800
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2011-12-14 10:56 +0200
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Eelco <hoogendoorn.eelco@gmail.com> - 2011-12-14 02:09 -0800
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2011-12-14 14:22 +0200
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Eelco <hoogendoorn.eelco@gmail.com> - 2011-12-14 04:41 -0800
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-12-14 12:38 +0000
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Eelco <hoogendoorn.eelco@gmail.com> - 2011-12-14 05:29 -0800
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Chris Angelico <rosuav@gmail.com> - 2011-12-15 00:39 +1100
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Ian Kelly <ian.g.kelly@gmail.com> - 2011-12-14 08:45 -0700
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Terry Reedy <tjreedy@udel.edu> - 2011-12-14 15:57 -0500
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] rusi <rustompmody@gmail.com> - 2011-12-14 03:47 -0800
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Chris Angelico <rosuav@gmail.com> - 2011-12-14 22:53 +1100
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2011-12-14 15:09 +0200
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-12-14 12:32 +0000
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2011-12-14 15:21 +0200
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Robert Kern <robert.kern@gmail.com> - 2011-12-15 10:47 +0000
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Eelco <hoogendoorn.eelco@gmail.com> - 2011-12-15 02:59 -0800
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] alex23 <wuwei23@gmail.com> - 2011-12-15 18:14 -0800
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] MRAB <python@mrabarnett.plus.com> - 2011-12-16 02:58 +0000
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Eelco <hoogendoorn.eelco@gmail.com> - 2011-12-16 02:36 -0800
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Chris Angelico <rosuav@gmail.com> - 2011-12-16 16:01 +1100
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] alex23 <wuwei23@gmail.com> - 2011-12-15 21:30 -0800
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Eelco <hoogendoorn.eelco@gmail.com> - 2011-12-16 02:25 -0800
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] rusi <rustompmody@gmail.com> - 2011-12-16 09:38 -0800
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Eelco <hoogendoorn.eelco@gmail.com> - 2011-12-16 11:40 -0800
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-12-17 12:49 +1300
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Eelco <hoogendoorn.eelco@gmail.com> - 2011-12-16 16:00 -0800
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Roy Smith <roy@panix.com> - 2011-12-16 19:03 -0500
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Grant Edwards <invalid@invalid.invalid> - 2011-12-17 20:02 +0000
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-12-17 00:54 +0000
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] David Robinow <drobinow@gmail.com> - 2011-12-16 21:11 -0500
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Chris Angelico <rosuav@gmail.com> - 2011-12-15 21:58 +1100
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] rusi <rustompmody@gmail.com> - 2011-12-15 03:04 -0800
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2011-12-15 14:48 +0200
Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] Terry Reedy <tjreedy@udel.edu> - 2011-12-15 18:15 -0500
Re: % is not an operator Paul Rudin <paul.nospam@rudin.co.uk> - 2011-12-14 09:43 +0000
Re: Verbose and flexible args and kwargs syntax Nick Dokos <nicholas.dokos@hp.com> - 2011-12-12 12:58 -0500
Re: Verbose and flexible args and kwargs syntax Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2011-12-14 11:04 +0200
Re: Verbose and flexible args and kwargs syntax gene heskett <gheskett@wdtv.com> - 2011-12-12 12:46 -0500
Re: Verbose and flexible args and kwargs syntax Dave Angel <d@davea.name> - 2011-12-12 13:04 -0500
Re: Verbose and flexible args and kwargs syntax Nick Dokos <nicholas.dokos@hp.com> - 2011-12-12 13:02 -0500
Page 3 of 5 — ← Prev page 1 2 [3] 4 5 Next page →
| From | Jussi Piitulainen <jpiitula@ling.helsinki.fi> |
|---|---|
| Date | 2011-12-12 20:09 +0200 |
| Message-ID | <qotliqh64r7.fsf@ruuvi.it.helsinki.fi> |
| In reply to | #17066 |
Eelco writes: > > They recognize modular arithmetic but for some reason insist that > > there is no such _binary operation_. But as I said, I don't understand > > their concern. (Except the related concern about some programming > > languages, not Python, where the remainder does not behave well with > > respect to division.) > > They might not be willing to define it, but as soon as we programmers > do, well, we did. > > Having studied the contemporary philosophy of mathematics, their > concern is probably that in their minds, mathematics is whatever some > dead guy said it was, and they dont know of any dead guy ever talking > about a modulus operation, so therefore it 'does not exist'. > > Whatever you want to call the concept we are talking about, or whether > you care to talk about it at all, it is most certainly a binary > operation, since there are two arguments involved. There is no way > around that. Yes, I think you nailed it. But I guess I'll still be confused the next time I meet one of them. Happens to me. :)
[toc] | [prev] | [next] | [standalone]
| From | Steven D'Aprano <steve+comp.lang.python@pearwood.info> |
|---|---|
| Date | 2011-12-14 03:18 +0000 |
| Subject | % is not an operator [was Re: Verbose and flexible args and kwargs syntax] |
| Message-ID | <4ee81592$0$11091$c3e8da3@news.astraweb.com> |
| In reply to | #17066 |
On Mon, 12 Dec 2011 09:29:11 -0800, Eelco wrote:
[quoting Jussi Piitulainen <jpiitula@ling.helsinki.fi>]
>> They recognize modular arithmetic but for some reason insist that there
>> is no such _binary operation_. But as I said, I don't understand their
>> concern. (Except the related concern about some programming languages,
>> not Python, where the remainder does not behave well with respect to
>> division.)
I've never come across this, and frankly I find it implausible that
*actual* mathematicians would say that. Likely you are misunderstanding a
technical argument about remainder being a relation rather than a
bijunction. The argument would go something like this:
"Remainder is not uniquely defined. For example, the division of -42 by
-5 can be written as either:
9*-5 + 3 = -42
8*-5 + -2 = -42
so the remainder is either 3 or -2. Hence remainder is not a bijection
(1:1 function)."
The existence of two potential answers for the remainder is certainly
correct, but the conclusion that remainder is not a binary operation
doesn't follow. It is a binary relation. Mathematicians are well able to
deal with little inconveniences like this, e.g. consider the square root:
10**2 = 100
(-10)**2 = 100
therefore the square root of 100 is ±10
Mathematicians get around this by defining the square root operator √ as
*only* the principle value of the square root relation, that is, the
positive root. Hence:
√100 = 10 only
If you want both roots, you have to explicitly ask for them both: ±√100
Similarly, we can sensibly define the remainder or modulus operator to
consistently return a non-negative remainder, or to do what Python does,
which is to return a remainder with the same sign as the divisor:
>>> 42 % 5
2
>>> -42 % 5
3
>>> 42 % -5
-3
>>> -42 % -5
-2
There may be practical or logical reasons for preferring one over the
other, but either choice would make remainder a bijection. One might even
define two separate functions/operators, one for each behaviour.
> They might not be willing to define it, but as soon as we programmers
> do, well, we did.
>
> Having studied the contemporary philosophy of mathematics, their concern
> is probably that in their minds, mathematics is whatever some dead guy
> said it was, and they dont know of any dead guy ever talking about a
> modulus operation, so therefore it 'does not exist'.
You've studied the contemporary philosophy of mathematics huh?
How about studying some actual mathematics before making such absurd
pronouncements on the psychology of mathematicians?
--
Steven
[toc] | [prev] | [next] | [standalone]
| From | Eelco <hoogendoorn.eelco@gmail.com> |
|---|---|
| Date | 2011-12-13 23:49 -0800 |
| Subject | Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] |
| Message-ID | <c6e76790-ce6c-43a2-93ab-6ca8012abda6@h11g2000yqd.googlegroups.com> |
| In reply to | #17178 |
On Dec 14, 4:18 am, Steven D'Aprano <steve +comp.lang.pyt...@pearwood.info> wrote: > > They might not be willing to define it, but as soon as we programmers > > do, well, we did. > > > Having studied the contemporary philosophy of mathematics, their concern > > is probably that in their minds, mathematics is whatever some dead guy > > said it was, and they dont know of any dead guy ever talking about a > > modulus operation, so therefore it 'does not exist'. > > You've studied the contemporary philosophy of mathematics huh? > > How about studying some actual mathematics before making such absurd > pronouncements on the psychology of mathematicians? The philosophy was just a sidehobby to the study of actual mathematics; and you are right, studying their works is the best way to get to know them. Speaking from that vantage point, I can say with certainty that the vast majority of mathematicians do not have a coherent philosophy, and they adhere to some loosely defined form of platonism. Indeed that is absurd in a way. Even though you may trust these people to be perfectly functioning deduction machines, you really shouldnt expect them to give sensible answers to the question of which are sensible axioms to adopt. They dont have a reasoned answer to this, they will by and large defer to authority.
[toc] | [prev] | [next] | [standalone]
| From | Arnaud Delobelle <arnodel@gmail.com> |
|---|---|
| Date | 2011-12-14 11:55 +0000 |
| Subject | Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] |
| Message-ID | <mailman.3637.1323863737.27778.python-list@python.org> |
| In reply to | #17185 |
On 14 December 2011 07:49, Eelco <hoogendoorn.eelco@gmail.com> wrote: > On Dec 14, 4:18 am, Steven D'Aprano <steve > +comp.lang.pyt...@pearwood.info> wrote: >> > They might not be willing to define it, but as soon as we programmers >> > do, well, we did. >> >> > Having studied the contemporary philosophy of mathematics, their concern >> > is probably that in their minds, mathematics is whatever some dead guy >> > said it was, and they dont know of any dead guy ever talking about a >> > modulus operation, so therefore it 'does not exist'. >> >> You've studied the contemporary philosophy of mathematics huh? >> >> How about studying some actual mathematics before making such absurd >> pronouncements on the psychology of mathematicians? > > The philosophy was just a sidehobby to the study of actual > mathematics; and you are right, studying their works is the best way > to get to know them. Speaking from that vantage point, I can say with > certainty that the vast majority of mathematicians do not have a > coherent philosophy, and they adhere to some loosely defined form of > platonism. Indeed that is absurd in a way. Even though you may trust > these people to be perfectly functioning deduction machines, you > really shouldnt expect them to give sensible answers to the question > of which are sensible axioms to adopt. They dont have a reasoned > answer to this, they will by and large defer to authority. Please come down from your vantage point for a few moments and consider how insulting your remarks are to people who have devoted most of their intellectual energy to the study of mathematics. So you've studied a bit of mathematics and a bit of philosophy? Good start, keep working at it. You think that every mathematician should be preoccupied with what axioms to adopt, and why? Mathematics is a very large field of study and yes, some mathematicians are concerned with these issues (they are called logicians) but for most it isn't really about axioms. Mathematics is bigger than the axioms that we use to formalise it. Most mathematicians do not need to care about what precise axiomatisation underlies the mathematics that they practise because they are thinking on a much higher level. Just like we do not worry about what machine language instruction actually performs each step of the Python program we are writing. You say that mathematicians defer to authority, but do you really think that thousands of years of evolution and refinement in mathematics are to be discarded lightly? I think not. It's good to have original ideas, to pursue them and to believe in them, but it would be foolish to think that they are superior to knowledge which has been accumulated over so many generations. You claim that mathematicians have a poor understanding of philosophy. It may be so for many of them, but how is this a problem? I doesn't prevent them from having a deep understanding of their field of mathematics. Do philosophers have a good understanding of mathematics? Cheers, -- Arnaud
[toc] | [prev] | [next] | [standalone]
| From | Eelco <hoogendoorn.eelco@gmail.com> |
|---|---|
| Date | 2011-12-14 04:33 -0800 |
| Subject | Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] |
| Message-ID | <98b76f0a-41bc-4864-8d9f-94d9a3a1d7b1@b32g2000yqn.googlegroups.com> |
| In reply to | #17199 |
On 14 dec, 12:55, Arnaud Delobelle <arno...@gmail.com> wrote: > On 14 December 2011 07:49, Eelco <hoogendoorn.ee...@gmail.com> wrote: > > On Dec 14, 4:18 am, Steven D'Aprano <steve > > +comp.lang.pyt...@pearwood.info> wrote: > >> > They might not be willing to define it, but as soon as we programmers > >> > do, well, we did. > > >> > Having studied the contemporary philosophy of mathematics, their concern > >> > is probably that in their minds, mathematics is whatever some dead guy > >> > said it was, and they dont know of any dead guy ever talking about a > >> > modulus operation, so therefore it 'does not exist'. > > >> You've studied the contemporary philosophy of mathematics huh? > > >> How about studying some actual mathematics before making such absurd > >> pronouncements on the psychology of mathematicians? > > > The philosophy was just a sidehobby to the study of actual > > mathematics; and you are right, studying their works is the best way > > to get to know them. Speaking from that vantage point, I can say with > > certainty that the vast majority of mathematicians do not have a > > coherent philosophy, and they adhere to some loosely defined form of > > platonism. Indeed that is absurd in a way. Even though you may trust > > these people to be perfectly functioning deduction machines, you > > really shouldnt expect them to give sensible answers to the question > > of which are sensible axioms to adopt. They dont have a reasoned > > answer to this, they will by and large defer to authority. > > Please come down from your vantage point for a few moments and > consider how insulting your remarks are to people who have devoted > most of their intellectual energy to the study of mathematics. So > you've studied a bit of mathematics and a bit of philosophy? Good > start, keep working at it. Thanks, I intend to. > You think that every mathematician should be preoccupied with what > axioms to adopt, and why? Of course I dont. If you wish to restrict your attention to the exploration of the consequences of axioms others throw at you, that is a perfectly fine specialization. Most mathematicians do exactly that, and thats fine. But that puts them in about as ill a position to judged what is, or shouldnt be defined, as the average plumber. Compounding the problem is not just that they do not wish to concern themselves with the inductive aspect of mathematics, they would like to pretend it does not exist at all. For instance, if you point out to them a 19th century mathematician used very different axioms than a 20th century one, (and point out they were both fine mathematicians that attained results universally celebrated), they will typically respond emotionally; get angry or at least annoyed. According to their pseudo-Platonist philosophy, mathematics should not have an inductive side, axioms are set in stone and not a human affair, and the way they answer the question as to where knowledge about the 'correct' mathematical axioms comes from is by an implicit or explicit appeal to authority. They dont explain how it is that they can see 'beyond the platonic cave' to find the 'real underlying truth', they quietly assume somebody else has figured it out in the past, and leave it at that. > You say that mathematicians defer to authority, but do you really > think that thousands of years of evolution and refinement in > mathematics are to be discarded lightly? I think not. It's good to > have original ideas, to pursue them and to believe in them, but it > would be foolish to think that they are superior to knowledge which > has been accumulated over so many generations. For what its worth; insofar as my views can be pidgeonholed, im with the classicists (pre-20th century), which indeed has a long history. Modernists in turn discard large swaths of that. Note that its largely an academic debate though; everybody agrees that 1+1=2. But there are some practical consequences; if I were the designated science-Tsar, all transfinite-analysist would be out on the street together with the homeopaths, for instance. > You claim that mathematicians have a poor understanding of philosophy. > It may be so for many of them, but how is this a problem? I doesn't > prevent them from having a deep understanding of their field of > mathematics. Do philosophers have a good understanding of > mathematics? As a rule of thumb: absolutely not, no. I dont think I can think of any philosopher who turned his attention to mathematics that ever wrote anything interesting. All the interesting writers had their boots on mathematical ground; Quine, Brouwer, Weyl and the earlier renaissance men like Gauss and contemporaries. The fragmentation of disciplines is infact a major problem in my opinion though. Most physicists take their mathematics from the ivory- math tower, and the mathematicians shudder at the idea of listning back to see which of what they cooked up is actually anything but mental masturbation, in the meanwhile cranking out more gibberish about alephs. If any well-reasoned philosophy enters into the mix, its usually in the spare time of one of the physicists, but it is assuredly not coming out of the philosophy department. There is something quite wrong with that state of affairs.
[toc] | [prev] | [next] | [standalone]
| From | Arnaud Delobelle <arnodel@gmail.com> |
|---|---|
| Date | 2011-12-14 16:13 +0000 |
| Subject | Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] |
| Message-ID | <mailman.3646.1323879243.27778.python-list@python.org> |
| In reply to | #17204 |
On 14 December 2011 12:33, Eelco <hoogendoorn.eelco@gmail.com> wrote: > On 14 dec, 12:55, Arnaud Delobelle <arno...@gmail.com> wrote: >> On 14 December 2011 07:49, Eelco <hoogendoorn.ee...@gmail.com> wrote: >> > On Dec 14, 4:18 am, Steven D'Aprano <steve >> > +comp.lang.pyt...@pearwood.info> wrote: >> >> > They might not be willing to define it, but as soon as we programmers >> >> > do, well, we did. >> >> >> > Having studied the contemporary philosophy of mathematics, their concern >> >> > is probably that in their minds, mathematics is whatever some dead guy >> >> > said it was, and they dont know of any dead guy ever talking about a >> >> > modulus operation, so therefore it 'does not exist'. >> >> >> You've studied the contemporary philosophy of mathematics huh? >> >> >> How about studying some actual mathematics before making such absurd >> >> pronouncements on the psychology of mathematicians? >> >> > The philosophy was just a sidehobby to the study of actual >> > mathematics; and you are right, studying their works is the best way >> > to get to know them. Speaking from that vantage point, I can say with >> > certainty that the vast majority of mathematicians do not have a >> > coherent philosophy, and they adhere to some loosely defined form of >> > platonism. Indeed that is absurd in a way. Even though you may trust >> > these people to be perfectly functioning deduction machines, you >> > really shouldnt expect them to give sensible answers to the question >> > of which are sensible axioms to adopt. They dont have a reasoned >> > answer to this, they will by and large defer to authority. >> >> Please come down from your vantage point for a few moments and >> consider how insulting your remarks are to people who have devoted >> most of their intellectual energy to the study of mathematics. So >> you've studied a bit of mathematics and a bit of philosophy? Good >> start, keep working at it. > > Thanks, I intend to. > >> You think that every mathematician should be preoccupied with what >> axioms to adopt, and why? > > Of course I dont. If you wish to restrict your attention to the > exploration of the consequences of axioms others throw at you, that is > a perfectly fine specialization. Most mathematicians do exactly that, > and thats fine. But that puts them in about as ill a position to > judged what is, or shouldnt be defined, as the average plumber. You are completely mistaken. Whatever the axiomatisation of the mathematics that we do, we can still do the same mathematics. We don't even need an axiomatic basis to do mathematics. In fact, the formalisation of mathematics has always come after the mathematics were well established. Euclid, Dedekind, Peano, Zermelo, Frankael, didn't create axiomatic systems out of nothing. They axiomatised pre-existing theories. Axiomatising a theory is just one way of exploring it. > Compounding the problem is not just that they do not wish to concern > themselves with the inductive aspect of mathematics, they would like > to pretend it does not exist at all. For instance, if you point out to > them a 19th century mathematician used very different axioms than a > 20th century one, (and point out they were both fine mathematicians > that attained results universally celebrated), they will typically > respond emotionally; get angry or at least annoyed. According to their > pseudo-Platonist philosophy, mathematics should not have an inductive > side, axioms are set in stone and not a human affair, and the way they > answer the question as to where knowledge about the 'correct' > mathematical axioms comes from is by an implicit or explicit appeal to > authority. They dont explain how it is that they can see 'beyond the > platonic cave' to find the 'real underlying truth', they quietly > assume somebody else has figured it out in the past, and leave it at > that. Again, you are completely mis-representing the situation. In my experience, most mathematicians (I'm not talking about undergraduate students here) do not see the axioms are the root of the mathematics that they do. Formal systems are just one way to explore mathematics. Of course they can in some cases be very useful and enlightening. As for inductive reasoning, I really can't understand your point. Of course mathematicians use inductive reasoning all the time. Where do you think the Riemann Hypothesis comes from? Or Fermat's last theorem? Do you think that mathematicians prove results before they even think about them? On the other hand, a result needs to be proved to be accepted by the mathematical community, and inductive reasoning is not valid in proofs. That's in the nature of mathematics. >> You say that mathematicians defer to authority, but do you really >> think that thousands of years of evolution and refinement in >> mathematics are to be discarded lightly? I think not. It's good to >> have original ideas, to pursue them and to believe in them, but it >> would be foolish to think that they are superior to knowledge which >> has been accumulated over so many generations. > > For what its worth; insofar as my views can be pidgeonholed, im with > the classicists (pre-20th century), which indeed has a long history. > Modernists in turn discard large swaths of that. Note that its largely > an academic debate though; everybody agrees that 1+1=2. But there are > some practical consequences; if I were the designated science-Tsar, > all transfinite-analysist would be out on the street together with the > homeopaths, for instance. It's telling that on the one hand you criticise mathematicians for not questioning the "axioms which are thrown at them", on the other hand you feel able to discard a perfectly fine piece of mathematics, that of the study of transfinite numbers, because it doesn't fit nicely with traditional views. The fact is that at the end of the 19th century mathematics had reached a crisis point. >> You claim that mathematicians have a poor understanding of philosophy. >> It may be so for many of them, but how is this a problem? I doesn't >> prevent them from having a deep understanding of their field of >> mathematics. Do philosophers have a good understanding of >> mathematics? > > As a rule of thumb: absolutely not, no. I dont think I can think of > any philosopher who turned his attention to mathematics that ever > wrote anything interesting. All the interesting writers had their > boots on mathematical ground; Quine, Brouwer, Weyl and the earlier > renaissance men like Gauss and contemporaries. > > The fragmentation of disciplines is infact a major problem in my > opinion though. Most physicists take their mathematics from the ivory- > math tower, and the mathematicians shudder at the idea of listning > back to see which of what they cooked up is actually anything but > mental masturbation, in the meanwhile cranking out more gibberish > about alephs. Only a minority of mathematicians have an interest in "alephs", as you call them. IMHO, the mathematics they do is perfectly valid. The exploration of the continuum hypothesis has led to the creation of very powerful mathematical techniques and gives an insight into the very foundations of mathematics. Again, on the one hand you criticise mathematicians for not questioning the axioms they work with, but those who investigate the way these axioms interact you accuse of "mental masturbation". -- Arnaud
[toc] | [prev] | [next] | [standalone]
| From | Eelco <hoogendoorn.eelco@gmail.com> |
|---|---|
| Date | 2011-12-14 09:15 -0800 |
| Subject | Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] |
| Message-ID | <91f6f2ec-25ac-4ca8-b654-f605a7c8a53e@c13g2000vbh.googlegroups.com> |
| In reply to | #17220 |
'Kindof' off-topic, but what the hell :). On Dec 14, 5:13 pm, Arnaud Delobelle <arno...@gmail.com> wrote: > On 14 December 2011 12:33, Eelco <hoogendoorn.ee...@gmail.com> wrote: > > On 14 dec, 12:55, Arnaud Delobelle <arno...@gmail.com> wrote: > >> On 14 December 2011 07:49, Eelco <hoogendoorn.ee...@gmail.com> wrote: > >> > On Dec 14, 4:18 am, Steven D'Aprano <steve > >> > +comp.lang.pyt...@pearwood.info> wrote: > >> >> > They might not be willing to define it, but as soon as we programmers > >> >> > do, well, we did. > > >> >> > Having studied the contemporary philosophy of mathematics, their concern > >> >> > is probably that in their minds, mathematics is whatever some dead guy > >> >> > said it was, and they dont know of any dead guy ever talking about a > >> >> > modulus operation, so therefore it 'does not exist'. > > >> >> You've studied the contemporary philosophy of mathematics huh? > > >> >> How about studying some actual mathematics before making such absurd > >> >> pronouncements on the psychology of mathematicians? > > >> > The philosophy was just a sidehobby to the study of actual > >> > mathematics; and you are right, studying their works is the best way > >> > to get to know them. Speaking from that vantage point, I can say with > >> > certainty that the vast majority of mathematicians do not have a > >> > coherent philosophy, and they adhere to some loosely defined form of > >> > platonism. Indeed that is absurd in a way. Even though you may trust > >> > these people to be perfectly functioning deduction machines, you > >> > really shouldnt expect them to give sensible answers to the question > >> > of which are sensible axioms to adopt. They dont have a reasoned > >> > answer to this, they will by and large defer to authority. > > >> Please come down from your vantage point for a few moments and > >> consider how insulting your remarks are to people who have devoted > >> most of their intellectual energy to the study of mathematics. So > >> you've studied a bit of mathematics and a bit of philosophy? Good > >> start, keep working at it. > > > Thanks, I intend to. > > >> You think that every mathematician should be preoccupied with what > >> axioms to adopt, and why? > > > Of course I dont. If you wish to restrict your attention to the > > exploration of the consequences of axioms others throw at you, that is > > a perfectly fine specialization. Most mathematicians do exactly that, > > and thats fine. But that puts them in about as ill a position to > > judged what is, or shouldnt be defined, as the average plumber. > > You are completely mistaken. Whatever the axiomatisation of the > mathematics that we do, we can still do the same mathematics. We > don't even need an axiomatic basis to do mathematics. In fact, the > formalisation of mathematics has always come after the mathematics > were well established. Euclid, Dedekind, Peano, Zermelo, Frankael, > didn't create axiomatic systems out of nothing. They axiomatised > pre-existing theories. > > Axiomatising a theory is just one way of exploring it. Yes, axiomization is to some extent a side-show. We know what it is that we want mathematics to be, and we try to find the axioms that lead to those conclusions. Not qualitatively different from any other form of induction (of the epistemological rather than mathematical kind). Still, different axioms or meta-mathematics give subtly different results, not to mention are as different to work with as assembler and haskell. There are no alephs if you start from a constructive basis, for instance. Im not sure what 'Axiomatising a theory is just one way of exploring it' means. One does not axiomatize a single theory; that would be trivial (A is true because thats what I define A to be). One constructs a single set of axioms from which a nontrivial set of theorems follow. The way id put it, is that axiomazation is about being explicit in what it is that you assume, trying to minimalize that, and being systematic about what conclusions that forces you to embrace. Could you be more precise as to how I am 'completely mistaken'? I acknowledge that my views are outside the mainstream, so its no news to me many would think so, but it would be nice to know what im arguing against in this thread precisely. > > Compounding the problem is not just that they do not wish to concern > > themselves with the inductive aspect of mathematics, they would like > > to pretend it does not exist at all. For instance, if you point out to > > them a 19th century mathematician used very different axioms than a > > 20th century one, (and point out they were both fine mathematicians > > that attained results universally celebrated), they will typically > > respond emotionally; get angry or at least annoyed. According to their > > pseudo-Platonist philosophy, mathematics should not have an inductive > > side, axioms are set in stone and not a human affair, and the way they > > answer the question as to where knowledge about the 'correct' > > mathematical axioms comes from is by an implicit or explicit appeal to > > authority. They dont explain how it is that they can see 'beyond the > > platonic cave' to find the 'real underlying truth', they quietly > > assume somebody else has figured it out in the past, and leave it at > > that. > > Again, you are completely mis-representing the situation. In my > experience, most mathematicians (I'm not talking about undergraduate > students here) do not see the axioms are the root of the mathematics > that they do. Formal systems are just one way to explore mathematics. > Of course they can in some cases be very useful and enlightening. Its your word versus mine I suppose. > As for inductive reasoning, I really can't understand your point. Of > course mathematicians use inductive reasoning all the time. Where do > you think the Riemann Hypothesis comes from? Or Fermat's last theorem? > Do you think that mathematicians prove results before they even think > about them? On the other hand, a result needs to be proved to be > accepted by the mathematical community, and inductive reasoning is not > valid in proofs. That's in the nature of mathematics. We mean something different by the term it seems. What you describe, I would call intuition. Which is indeed very important in mathematics, and indeed no substitute for deduction. By induction, I mean the process of reducing particular facts/observations/theorems to a more compact body of theory/axioms that imply the same. In a way, its the inverse of deduction (seeing which body of conclusions follows from a given set of axioms) > >> You say that mathematicians defer to authority, but do you really > >> think that thousands of years of evolution and refinement in > >> mathematics are to be discarded lightly? I think not. It's good to > >> have original ideas, to pursue them and to believe in them, but it > >> would be foolish to think that they are superior to knowledge which > >> has been accumulated over so many generations. > > > For what its worth; insofar as my views can be pidgeonholed, im with > > the classicists (pre-20th century), which indeed has a long history. > > Modernists in turn discard large swaths of that. Note that its largely > > an academic debate though; everybody agrees that 1+1=2. But there are > > some practical consequences; if I were the designated science-Tsar, > > all transfinite-analysist would be out on the street together with the > > homeopaths, for instance. > > It's telling that on the one hand you criticise mathematicians for not > questioning the "axioms which are thrown at them", on the other hand > you feel able to discard a perfectly fine piece of mathematics, that > of the study of transfinite numbers, because it doesn't fit nicely > with traditional views. The fact is that at the end of the 19th > century mathematics had reached a crisis point. It is a shame you both fail to specify by what metric it is a perfectly fine piece of mathematics, and yet more egregiously, put words into my mouth as to what I think is wrong with it. That makes for slow and painful debating. My objection to transfinite analysis is that it is not scientific, in the sense that I judge most parts of mathematics to be. I am not questioning its deductive validity; that something mathematicians can generally be trusted with. My contention is that the axioms that give rise to transfinite analysis are of the same 'validity' as any random set of axioms you could pull from a random number generator. All sets of axioms have implications, but we dont study all possible sets of axioms. Studying a random set of axioms leads to an arbitrary number of nonsensical results; nonsensical in the common day useage of the word, and nonsensical in a philosophical sense; as not relating to any sense-impressions, or synthetic propositions. Transfinite analysis does not give any results of any relevance that im aware of, but id love to be proven wrong. The fact that we do get this cancerous outgrowth of implications called transfinite analysis is a hint that these axioms are borked; not a beautiful view on a world of truth beyond our senses that only mathematics can give us. (again, in my minority opinion). Id love to debate you as to where exactly I suspect things went wrong, but its a lengthy story, and its really not the right place I suppose; nor the right time, I have to cook. > >> You claim that mathematicians have a poor understanding of philosophy. > >> It may be so for many of them, but how is this a problem? I doesn't > >> prevent them from having a deep understanding of their field of > >> mathematics. Do philosophers have a good understanding of > >> mathematics? > > > As a rule of thumb: absolutely not, no. I dont think I can think of > > any philosopher who turned his attention to mathematics that ever > > wrote anything interesting. All the interesting writers had their > > boots on mathematical ground; Quine, Brouwer, Weyl and the earlier > > renaissance men like Gauss and contemporaries. > > > The fragmentation of disciplines is infact a major problem in my > > opinion though. Most physicists take their mathematics from the ivory- > > math tower, and the mathematicians shudder at the idea of listning > > back to see which of what they cooked up is actually anything but > > mental masturbation, in the meanwhile cranking out more gibberish > > about alephs. > > Only a minority of mathematicians have an interest in "alephs", as you > call them. I know. > IMHO, the mathematics they do is perfectly valid. The > exploration of the continuum hypothesis has led to the creation of > very powerful mathematical techniques and gives an insight into the > very foundations of mathematics. Like I said, I dont question its deductive validity. As for providing insight into the deductive process; probably, but so do Sudoku's, and I dont see them being state-sponsored across the globe. Any self- created puzzle will do for that purpose; and I suspect the same time spent on real puzzles has the same effect, plus more. > Again, on the one hand you criticise > mathematicians for not questioning the axioms they work with, but > those who investigate the way these axioms interact you accuse of > "mental masturbation". In my, admittedly outsider view of things, transfinite analysis are rather sad deduction machines. Id be delighted if you could show me one that has done some kind of reflection as to why they so fervently keep chasing the ghosts that the likes of Hilbert and Russel conjured up for them, or that have even bothered to expose themselves to the mockery that the likes of Gauss would have showered upon them (or Feynmann, for a more recent but imperfect analog).
[toc] | [prev] | [next] | [standalone]
| From | rusi <rustompmody@gmail.com> |
|---|---|
| Date | 2011-12-14 19:43 -0800 |
| Subject | Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] |
| Message-ID | <359cdc5e-c955-42fc-a419-3722bae45850@k5g2000pra.googlegroups.com> |
| In reply to | #17226 |
On Dec 14, 10:15 pm, Eelco <hoogendoorn.ee...@gmail.com> wrote: > 'Kindof' off-topic, but what the hell :). <deja-vu> We keep having these debates -- so I wonder how off-topic it is... And so do famous CSists: http://research.microsoft.com/en-us/um/people/gurevich/opera/123.pdf </deja-vu> : : > > Again, you are completely mis-representing the situation. In my > > experience, most mathematicians (I'm not talking about undergraduate > > students here) do not see the axioms are the root of the mathematics > > that they do. Formal systems are just one way to explore mathematics. > > Of course they can in some cases be very useful and enlightening. > > Its your word versus mine I suppose. Some older discussions: http://groups.google.com/group/comp.lang.python/browse_thread/thread/46435c36f3a13621/896579b757126243?lnk=gst&q=rusi+steven+platonism#896579b757126243 http://groups.google.com/group/comp.lang.python/browse_thread/thread/d36dcd2e2e175d1e/45dd596bc050ac2d?lnk=gst&q=rusi+steven+platonism#45dd596bc050ac2d
[toc] | [prev] | [next] | [standalone]
| From | Eelco <hoogendoorn.eelco@gmail.com> |
|---|---|
| Date | 2011-12-15 01:44 -0800 |
| Subject | Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] |
| Message-ID | <f5cbe92a-5695-4281-8179-cfb085b11a24@o9g2000yqa.googlegroups.com> |
| In reply to | #17247 |
On Dec 15, 4:43 am, rusi <rustompm...@gmail.com> wrote: > On Dec 14, 10:15 pm, Eelco <hoogendoorn.ee...@gmail.com> wrote: > > > 'Kindof' off-topic, but what the hell :). > > <deja-vu> > We keep having these debates -- so I wonder how off-topic it is... > And so do famous CSists:http://research.microsoft.com/en-us/um/people/gurevich/opera/123.pdf > </deja-vu> Well, you are right, there are some deep links here. My view of what is wrong with mainstream mathematics is its strange interpretation of the semantics of classical logic. (And I dont think any other schools get it quite right either; I think finitists may avoid the mistakes of others, but are rightfully accussed of being needlessly restrictive, for instance) This is best illustrated by means of the principle of explosion. It rests on assuming a contradiction, and then assigning rather peculiar semantics to them. What is typically left unstated are the semantics of symbol lookup, but apparently it is implicitly understood one can pick whatever value upon encountering a contradicting symbol. There is no well defined rule for the lookup of a twice-defined symbol. Of course the sane thing to do, to a mind grown up around computer languages, upon encountering a twice defined symbol, is not to continue to generate deductions from both branches, but to throw an exception and interrupt the specific line of reasoning that depends on this contradicting symbol right then and there. Conceptually, we can see something is wrong with these undefined semantics right away. A logical system that allows you to draw conclusions as to where the pope shits from assertions about natural numbers could not more obviously be broken. If you dont have this broken way of dealing with contradictions, one does not have to do one of many silly and arbitrary things to make infinity work, such as making a choice between one-to-one correspondence and subset-relations for determining the cardinality of a set; one can simply admit the concept of infinity, while useful, is not consistent, keep the contradiction well handled instead of having it explode in your face (or explode into the field of transfinite analysis; a consequece of 'dealing' with these issues by rejecting the intuitively obviously true relation between subset relations and cardinality), and continue reasoning with the branches of your argument that you are interested in. In other words, what logic needs is a better exception-handling system, which completes the circle with programming languages quite nicely. :)
[toc] | [prev] | [next] | [standalone]
| From | rusi <rustompmody@gmail.com> |
|---|---|
| Date | 2011-12-15 02:56 -0800 |
| Subject | Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] |
| Message-ID | <d1d99884-9878-4469-9565-26a473b3854a@h37g2000pri.googlegroups.com> |
| In reply to | #17257 |
On Dec 15, 2:44 pm, Eelco <hoogendoorn.ee...@gmail.com> wrote: > In other words, what logic needs is a better exception-handling > system, which completes the circle with programming languages quite > nicely. :) Cute... but dangerously recursive (if taken literally) Remember that logic is the foundation of programming language semantics. And your idea (suggests) that programming language semantics be made (part of) the foundation of logic. Of course I assume you are not being very literal. Still the dangers of unnoticed circularity are often... well unnoticed :-) eg. McCarthy gave the semantics of lisp in lisp -- a lisp interpreter in lisp is about a page of code. It probably was a decade before someone realized that the same semantics would 'work' for lazy or applicative (eager) order evaluation. This then begs the question what exactly it means for that semantics to 'work'...
[toc] | [prev] | [next] | [standalone]
| From | Eelco <hoogendoorn.eelco@gmail.com> |
|---|---|
| Date | 2011-12-15 03:37 -0800 |
| Subject | Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] |
| Message-ID | <b01ef433-d14f-4e13-bf56-22ad0822ec24@u5g2000vbd.googlegroups.com> |
| In reply to | #17259 |
On Dec 15, 11:56 am, rusi <rustompm...@gmail.com> wrote: > On Dec 15, 2:44 pm, Eelco <hoogendoorn.ee...@gmail.com> wrote: > > > In other words, what logic needs is a better exception-handling > > system, which completes the circle with programming languages quite > > nicely. :) > > Cute... but dangerously recursive (if taken literally) > Remember that logic is the foundation of programming language > semantics. > And your idea (suggests) that programming language semantics be made > (part of) the foundation of logic. > > Of course I assume you are not being very literal. > Still the dangers of unnoticed circularity are often... well > unnoticed :-) Well, logic as a language has semantics, one way or the other. This circularity is a general theme in epistemology, and one that fits well with the view of deduction-induction as a closed loop cycle. Knowledge does not flow from axioms to theorems; axioms without an encompassing context are meaningless symbols. Its a body of knowledge as a whole that should be put to the test; the language and the things we express in it are inseperable. (the not-quite-famous-enough Quine in a nutshell) The thing is that our semantics of logic are quite primitive; cooked up in a time where people spent far less time thinking about these things, and having a far narrower base of experience to draw ideas from. They didnt have the luxury of already having grown up studying a dozen formal languages before embarking on creating their own. It other words, the semantics of logic is a legacy piece of crap, but an insanely firmly entrenched one. I mean, there are many sensible ways of defining semantics of conflicting symbols, but you'll find on studying these things that the guys who (often implicitly) laid down these rules didnt even seemed to have consciously thought about them. Not because they were stupid; far from it, but for similar reasons as to why the x86 architecture wasnt concieved of the day after the invention of the transistor.
[toc] | [prev] | [next] | [standalone]
| From | Jussi Piitulainen <jpiitula@ling.helsinki.fi> |
|---|---|
| Date | 2011-12-14 10:56 +0200 |
| Subject | Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] |
| Message-ID | <qotipljcz19.fsf@ruuvi.it.helsinki.fi> |
| In reply to | #17178 |
Steven D'Aprano writes: > On Mon, 12 Dec 2011 09:29:11 -0800, Eelco wrote: > > [quoting Jussi Piitulainen <jpiitula@ling.helsinki.fi>] > >> They recognize modular arithmetic but for some reason insist that > >> there is no such _binary operation_. But as I said, I don't > >> understand their concern. (Except the related concern about some > >> programming languages, not Python, where the remainder does not > >> behave well with respect to division.) > > I've never come across this, and frankly I find it implausible that > *actual* mathematicians would say that. Likely you are > misunderstanding a technical argument about remainder being a > relation rather than a bijunction. The argument would go something > like this: (For 'bijunction', read 'function'.) I'm not misunderstanding any argument. There was no argument. There was a blanket pronouncement that _in mathematics_ mod is not a binary operator. I should learn to challenge such pronouncements and ask what the problem is. Maybe next time. But you are right that I don't know how actual mathematicians these people are. I'm not a mathematician. I don't know where to draw the line. A Finnish actual mathematician stated a similar prejudice towards mod as a binary operator in a Finnish group. I asked him what is wrong with Knuth's definition (remainder after flooring division), and I think he conceded that it's not wrong. Number theorists just choose to work with congruence relations. I have no problem with that. He had experience with students who confused congruences modulo some modulus with a binary operation, and mixed up their notations because of that. That is a reason to be suspicious, but it is a confusion on the part of the students. Graham, Knuth, Patashnik contrast the two concepts explicitly, no confusion there. And I know that there are many ways to define division and remainder so that x div y + x rem y = x. Boute's paper cited in [1] advocates a different one and discusses others. [1] <http://en.wikipedia.org/wiki/Modulo_operation> But I think the argument "there are several such functions, therefore, _in mathematics_, there is no such function" is its own caricature. > "Remainder is not uniquely defined. For example, the division of -42 > by -5 can be written as either: > > 9*-5 + 3 = -42 > 8*-5 + -2 = -42 > > so the remainder is either 3 or -2. Hence remainder is not a bijection > (1:1 function)." Is someone saying that _division_ is not defined because -42 div -5 is somehow both 9 and 8? Hm, yes, I see that someone might. The two operations, div and rem, need to be defined together. (There is no way to make remainder a bijection. You mean it is not a function if it is looked at in a particular way.) [The square root was relevant but I snipped it.] > Similarly, we can sensibly define the remainder or modulus operator > to consistently return a non-negative remainder, or to do what > Python does, which is to return a remainder with the same sign as > the divisor: ... > There may be practical or logical reasons for preferring one over > the other, but either choice would make remainder a bijection. One > might even define two separate functions/operators, one for each > behaviour. Scheme is adopting flooring division, ceiling-ing division, rounding division, truncating division, centering division, and the Euclidean division advocated by Boute, and the corresponding remainders. There is no better way to bring home to a programmer the points that there are different ways to define these, and they come as div _and_ rem.
[toc] | [prev] | [next] | [standalone]
| From | Eelco <hoogendoorn.eelco@gmail.com> |
|---|---|
| Date | 2011-12-14 02:09 -0800 |
| Subject | Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] |
| Message-ID | <78d2ba1b-0ea2-49a8-88f4-d85186bb2317@f11g2000yql.googlegroups.com> |
| In reply to | #17186 |
On 14 dec, 09:56, Jussi Piitulainen <jpiit...@ling.helsinki.fi> wrote: > Steven D'Aprano writes: > > On Mon, 12 Dec 2011 09:29:11 -0800, Eelco wrote: > > > [quoting Jussi Piitulainen <jpiit...@ling.helsinki.fi>] > > >> They recognize modular arithmetic but for some reason insist that > > >> there is no such _binary operation_. But as I said, I don't > > >> understand their concern. (Except the related concern about some > > >> programming languages, not Python, where the remainder does not > > >> behave well with respect to division.) > > > I've never come across this, and frankly I find it implausible that > > *actual* mathematicians would say that. Likely you are > > misunderstanding a technical argument about remainder being a > > relation rather than a bijunction. The argument would go something > > like this: > > (For 'bijunction', read 'function'.) > > I'm not misunderstanding any argument. There was no argument. There > was a blanket pronouncement that _in mathematics_ mod is not a binary > operator. I should learn to challenge such pronouncements and ask what > the problem is. Maybe next time. > > But you are right that I don't know how actual mathematicians these > people are. I'm not a mathematician. I don't know where to draw the > line. > > A Finnish actual mathematician stated a similar prejudice towards mod > as a binary operator in a Finnish group. I asked him what is wrong > with Knuth's definition (remainder after flooring division), and I > think he conceded that it's not wrong. Number theorists just choose to > work with congruence relations. I have no problem with that. > > He had experience with students who confused congruences modulo some > modulus with a binary operation, and mixed up their notations because > of that. That is a reason to be suspicious, but it is a confusion on > the part of the students. Graham, Knuth, Patashnik contrast the two > concepts explicitly, no confusion there. > > And I know that there are many ways to define division and remainder > so that x div y + x rem y = x. Boute's paper cited in [1] advocates a > different one and discusses others. > > [1] <http://en.wikipedia.org/wiki/Modulo_operation> > > But I think the argument "there are several such functions, therefore, > _in mathematics_, there is no such function" is its own caricature. Indeed. Obtaining a well defined function is just a matter of picking a convention and sticking with it. Arguably, the most elegant thing to do is to define integer division and remainder as a single operation; which is not only the logical thing to do mathematically, but might work really well programmatically too. The semantics of python dont really allow for this though. One could have: d, r = a // b But it wouldnt work that well in composite expressions; selecting the right tuple index would be messy and a more verbose form would be preferred. However, performance-wise its also clearly the best solution, as one often needs both output arguments and computing them simultaniously is most efficient. At least numpy should have something like: d, r = np.integer_division(a, b) And something similar in the math module for scalars. > > "Remainder is not uniquely defined. For example, the division of -42 > > by -5 can be written as either: > > > 9*-5 + 3 = -42 > > 8*-5 + -2 = -42 > > > so the remainder is either 3 or -2. Hence remainder is not a bijection > > (1:1 function)." > > Is someone saying that _division_ is not defined because -42 div -5 is > somehow both 9 and 8? Hm, yes, I see that someone might. The two > operations, div and rem, need to be defined together. > > (There is no way to make remainder a bijection. You mean it is not a > function if it is looked at in a particular way.) Surjection is the word you are looking for That is, if one buys the philosophy of modernists like bourbaki in believing there is much to be gained by such pedantry.
[toc] | [prev] | [next] | [standalone]
| From | Jussi Piitulainen <jpiitula@ling.helsinki.fi> |
|---|---|
| Date | 2011-12-14 14:22 +0200 |
| Subject | Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] |
| Message-ID | <qot1us7gx6k.fsf@ruuvi.it.helsinki.fi> |
| In reply to | #17193 |
Eelco writes: > On 14 dec, 09:56, Jussi Piitulainen wrote: > > But I think the argument "there are several such functions, > > therefore, _in mathematics_, there is no such function" is its own > > caricature. > > Indeed. Obtaining a well defined function is just a matter of > picking a convention and sticking with it. > > Arguably, the most elegant thing to do is to define integer division > and remainder as a single operation; which is not only the logical > thing to do mathematically, but might work really well > programmatically too. > > The semantics of python dont really allow for this though. One could > have: > > d, r = a // b > > But it wouldnt work that well in composite expressions; selecting the > right tuple index would be messy and a more verbose form would be > preferred. However, performance-wise its also clearly the best > solution, as one often needs both output arguments and computing them > simultaniously is most efficient. The current Scheme draft does this. For each rounding method, it provides an operation that provides both the quotient and the remainder, an operation that provides the quotient, and an operation that provides the remainder. The both-values operation is more awkward to compose, as you rightly say. It's just a matter of naming them all. Python has a good default integer division as the pair of operators // and %. Python also supports the returning of several values from functions as tuples. It can be done. > > Is someone saying that _division_ is not defined because -42 div > > -5 is somehow both 9 and 8? Hm, yes, I see that someone might. The > > two operations, div and rem, need to be defined together. > > > > (There is no way to make remainder a bijection. You mean it is not > > a function if it is looked at in a particular way.) > > Surjection is the word you are looking for Um, no, I mean function. The allegedly alleged problem is that there may be two (or more) different values for f(x,y), which makes f not a _function_ (and the notation f(x,y) maybe inappropriate). Surjectivity is as much beside the point as bijectivity, but I think we have surjectivity for rem: Z * Z -> Z if we use a definition that produces both positive and negative remainders, or rem: Z * Z -> N if we have non-negative remainders (and include 0 in N, which is another bone of contention). We may or may not want to exclude 0 as the modulus, or divisor if you like. It is at least a special case. It's injectivity that fails: 9 % 4 == 6 % 5 == 3 % 2, while Python quite sensibly has (9, 4) != (6, 5) != (3, 2). (How I love the chaining of the comparisons.) > That is, if one buys the philosophy of modernists like bourbaki in > believing there is much to be gained by such pedantry. I think something is gained. Not sure I would call it philosophy.
[toc] | [prev] | [next] | [standalone]
| From | Eelco <hoogendoorn.eelco@gmail.com> |
|---|---|
| Date | 2011-12-14 04:41 -0800 |
| Subject | Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] |
| Message-ID | <0dd668cd-815c-4027-9421-5fc22ed89b68@n6g2000vbg.googlegroups.com> |
| In reply to | #17202 |
On 14 dec, 13:22, Jussi Piitulainen <jpiit...@ling.helsinki.fi> wrote: > > > Is someone saying that _division_ is not defined because -42 div > > > -5 is somehow both 9 and 8? Hm, yes, I see that someone might. The > > > two operations, div and rem, need to be defined together. > > > > (There is no way to make remainder a bijection. You mean it is not > > > a function if it is looked at in a particular way.) > > > Surjection is the word you are looking for > > Um, no, I mean function. The allegedly alleged problem is that there > may be two (or more) different values for f(x,y), which makes f not a > _function_ (and the notation f(x,y) maybe inappropriate). > > Surjectivity is as much beside the point as bijectivity, but I think > we have surjectivity for rem: Z * Z -> Z if we use a definition that > produces both positive and negative remainders, or rem: Z * Z -> N if > we have non-negative remainders (and include 0 in N, which is another > bone of contention). We may or may not want to exclude 0 as the > modulus, or divisor if you like. It is at least a special case. > > It's injectivity that fails: 9 % 4 == 6 % 5 == 3 % 2, while Python > quite sensibly has (9, 4) != (6, 5) != (3, 2). (How I love the > chaining of the comparisons.) My reply was more to the statement you quoted than to yours; sorry for the confusion. Yes, we have surjectivity and not injectivity, thats all I was trying to say. > > That is, if one buys the philosophy of modernists like bourbaki in > > believing there is much to be gained by such pedantry. > > I think something is gained. Not sure I would call it philosophy. Agreed; its more the notion that one stands to gain much real knowledge by writing volumnius books about these matters that irks me, but I guess thats more a matter of taste than philosophy.
[toc] | [prev] | [next] | [standalone]
| From | Steven D'Aprano <steve+comp.lang.python@pearwood.info> |
|---|---|
| Date | 2011-12-14 12:38 +0000 |
| Subject | Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] |
| Message-ID | <4ee898c6$0$29979$c3e8da3$5496439d@news.astraweb.com> |
| In reply to | #17193 |
On Wed, 14 Dec 2011 02:09:32 -0800, Eelco wrote: > Arguably, the most elegant thing to do is to define integer division and > remainder as a single operation; which is not only the logical thing to > do mathematically, but might work really well programmatically too. > > The semantics of python dont really allow for this though. One could > have: > > d, r = a // b That would be: >>> divmod(17, 5) (3, 2) > But it wouldnt work that well in composite expressions; selecting the > right tuple index would be messy and a more verbose form would be > preferred. However, performance-wise its also clearly the best solution, > as one often needs both output arguments and computing them > simultaniously is most efficient. Premature optimization. -- Steven
[toc] | [prev] | [next] | [standalone]
| From | Eelco <hoogendoorn.eelco@gmail.com> |
|---|---|
| Date | 2011-12-14 05:29 -0800 |
| Subject | Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] |
| Message-ID | <0d38ea3b-46ff-4fbc-9a1c-8e028c3a7d8b@n10g2000vbg.googlegroups.com> |
| In reply to | #17205 |
On Dec 14, 1:38 pm, Steven D'Aprano <steve +comp.lang.pyt...@pearwood.info> wrote: > On Wed, 14 Dec 2011 02:09:32 -0800, Eelco wrote: > > Arguably, the most elegant thing to do is to define integer division and > > remainder as a single operation; which is not only the logical thing to > > do mathematically, but might work really well programmatically too. > > > The semantics of python dont really allow for this though. One could > > have: > > > d, r = a // b > > That would be: > > >>> divmod(17, 5) > > (3, 2) Cool; if only it were in the math module id be totally happy. > > But it wouldnt work that well in composite expressions; selecting the > > right tuple index would be messy and a more verbose form would be > > preferred. However, performance-wise its also clearly the best solution, > > as one often needs both output arguments and computing them > > simultaniously is most efficient. > > Premature optimization. We are talking language design here, not language use. Whether or not this is premature is a decision that should be left to the user, if at all possible, which in this case it very well is; just provide multiple functions to cover all use cases (only return divisor, only return remainder, or both)
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2011-12-15 00:39 +1100 |
| Subject | Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] |
| Message-ID | <mailman.3644.1323869950.27778.python-list@python.org> |
| In reply to | #17212 |
On Thu, Dec 15, 2011 at 12:29 AM, Eelco <hoogendoorn.eelco@gmail.com> wrote: > On Dec 14, 1:38 pm, Steven D'Aprano <steve > +comp.lang.pyt...@pearwood.info> wrote: >> That would be: >> >> >>> divmod(17, 5) >> >> (3, 2) > > Cool; if only it were in the math module id be totally happy. That's easily solved. import math math.divmod=divmod del __builtins__.divmod :) ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Ian Kelly <ian.g.kelly@gmail.com> |
|---|---|
| Date | 2011-12-14 08:45 -0700 |
| Subject | Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] |
| Message-ID | <mailman.3645.1323877538.27778.python-list@python.org> |
| In reply to | #17212 |
On Wed, Dec 14, 2011 at 6:29 AM, Eelco <hoogendoorn.eelco@gmail.com> wrote: > On Dec 14, 1:38 pm, Steven D'Aprano <steve > +comp.lang.pyt...@pearwood.info> wrote: >> On Wed, 14 Dec 2011 02:09:32 -0800, Eelco wrote: >> > Arguably, the most elegant thing to do is to define integer division and >> > remainder as a single operation; which is not only the logical thing to >> > do mathematically, but might work really well programmatically too. >> >> > The semantics of python dont really allow for this though. One could >> > have: >> >> > d, r = a // b >> >> That would be: >> >> >>> divmod(17, 5) >> >> (3, 2) > > Cool; if only it were in the math module id be totally happy. Probably it's not in math because it's not a thin wrapper around a C math library function, which is how the module was conceived. There are already some exceptions in the math module, but I think they are all newer than divmod.
[toc] | [prev] | [next] | [standalone]
| From | Terry Reedy <tjreedy@udel.edu> |
|---|---|
| Date | 2011-12-14 15:57 -0500 |
| Subject | Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax] |
| Message-ID | <mailman.3656.1323896280.27778.python-list@python.org> |
| In reply to | #17193 |
On 12/14/2011 5:09 AM, Eelco wrote: > Arguably, the most elegant thing to do is to define integer division > and remainder as a single operation; It actually is, as quotient and remainder are calculated together. The microprocessors I know of expose this (as does Python). 'a divmod b' puts the quotient in one register and the remainder in another. If you ask for just one of the two values, both are calculated and one is grabbed while the other is returned. > which is not only the logical > thing to do mathematically, but might work really well > programmatically too. > > The semantics of python dont really allow for this though. One could > have: > > d, r = a // b >>> a,b = divmod(10,3) >>> a,b (3, 1) With CPython, int.__divmod__ lightly wraps and exposes the processor operation. > But it wouldnt work that well in composite expressions; selecting the > right tuple index would be messy and a more verbose form would be > preferred. That is why we have >>> a == 10 // 3 True >>> b == 10 % 3 True In both cases, I believe CPython calls int.__divmod__ (or the lower level equivalent) to calculate both values, and one is returned while the other is ignored. It it the same when one does long division by hand. > However, performance-wise its also clearly the best > solution, as one often needs both output arguments and computing them > simultaniously is most efficient. As indicated above, there is really no choice but to calculate both at once. If one needs both a//b and a%b, one should explicitly call divmod once and save (name) both values, instead of calling it implicitly twice and tossing half the answer each time. -- Terry Jan Reedy
[toc] | [prev] | [next] | [standalone]
Page 3 of 5 — ← Prev page 1 2 [3] 4 5 Next page →
Back to top | Article view | comp.lang.python
csiph-web