Re: "Worst bugs" and Python?

2020-12-18 Thread Rich Shepard
On Sat, 19 Dec 2020, dn via Python-list wrote: Companies such as Microsoft and Oracle (plus, plus, ...) do not allow just-anyone to analyse their source-code - whereas 'open source' is available for analysis, by definition! An easy 'target' for shallow analysis? Looks bass-ackwards to me. That

RE: dict.get(key, default) evaluates default even if key exists

2020-12-18 Thread Schachner, Joseph
Yes. In order to call D.get( ) it needs to pass two arguments. The first is 'a', simple. The second is the result of a call to get_default(). So, that is called. From INSIDE get_default() it prints 'Nobody expects this' but you should expect it, get_default() gets executed. Following th

"Worst bugs" and Python?

2020-12-18 Thread dn via Python-list
TechRepublic have published a lovely piece of 'click-bait' featuring alarmist claims such as "open-source libraries are increasingly untrustworthy" whilst trotting-out tired, old, memes and bias. Don't panic - hold-on to your PyPi! <<< The worst bugs in the top programming languages by Brando

Re: Lambda in parameters

2020-12-18 Thread Grant Edwards
On 2020-12-18, Barry wrote: >> Implement car and cdr. > Why car and cdr? > > Well obviously car is content of the address register and cdr is content of > data register. > Apparently an artefact of a early implementation of lisp. While car and cdr are lisp operators, the "content of address reg

Re: Review, suggestion etc?

2020-12-18 Thread Grant Edwards
On 2020-12-18, Joe Pfeiffer wrote: > Grant Edwards writes: > >> Yep, there are definitly cases where it's pretty much the only right >> answer. If you try to avoid it, you end up writing what turns into a >> simulation of recursion -- and doing that correctly isn't easy. > > Decades ago I had to

Re: Lambda in parameters

2020-12-18 Thread Julio Di Egidio
On Friday, 18 December 2020 at 15:20:59 UTC+1, Abdur-Rahmaan Janhangeer wrote: > The Question: > > # --- > This problem was asked by Jane Street. > > cons(a, b) constructs a pair, and car(pair) and cdr(pair) returns the first > and last element of that pair. For example, car(cons(3, 4)) retur

RE: setuptools issue

2020-12-18 Thread Rich Shepard
On Fri, 18 Dec 2020, Joseph L. Casale wrote: I just ran into this recently, I don't recall the actual source but it was the version of setuptools having been so old. Your version is from Jun 3, 2016... Update it, that was what worked for me. jlc, Upgraded to python-setuptools-51.0.0-x86_64. N

Re: Lambda in parameters

2020-12-18 Thread Barry
> On 18 Dec 2020, at 14:23, Abdur-Rahmaan Janhangeer > wrote: > > The Question: > > # --- > This problem was asked by Jane Street. > > cons(a, b) constructs a pair, and car(pair) and cdr(pair) returns the first > and last element of that pair. For example, car(cons(3, 4)) returns 3, and > c

Re: Review, suggestion etc?

2020-12-18 Thread Joe Pfeiffer
Grant Edwards writes: > On 2020-12-18, Joe Pfeiffer wrote: > >> Recursion has very limited application, but where it's the right >> tool it's invaluable (top-down parsers, some graph algorithms...). >> We teach it primarily because by the time a student has a good >> handle on how to write a re

Re: Lambda in parameters

2020-12-18 Thread Abdur-Rahmaan Janhangeer
The Question: # --- This problem was asked by Jane Street. cons(a, b) constructs a pair, and car(pair) and cdr(pair) returns the first and last element of that pair. For example, car(cons(3, 4)) returns 3, and cdr(cons(3, 4)) returns 4. Given this implementation of cons: def cons(a, b): def

Re: Function returns old value

2020-12-18 Thread Christian Gollwitzer
Am 17.12.20 um 21:22 schrieb Michael F. Stemper: On 17/12/2020 03.57, Peter J. Holzer wrote: On 2020-12-17 03:06:32 -, Bischoop wrote: pasting from my IDE to vim/slrn was messing syntax, You can :set paste in vim to prevent it from messing with pasted content (don't forget to set nopast