Re: Hello World

2015-01-17 Thread Chris Angelico
On Sun, Jan 18, 2015 at 2:45 PM, Steven D'Aprano wrote: > (I am very cynical about most of the "security features" the banks are > pushing for, since in my opinion they are more about giving the banks > plausible deniablity so they can push responsibility for security breaches > onto the customer.

Re: Hello World

2015-01-17 Thread Chris Angelico
On Sun, Jan 18, 2015 at 2:50 PM, Tim Chase wrote: > You think that's bad, one million Google Authenticator 2-factor > verification codes were leaked: > > https://twitter.com/paulmutton/status/509991378647277568 > > Those hackers are a wily bunch. ;-) http://torrent-city.net/download/Li/List-of-A

Re: Hello World

2015-01-17 Thread Tim Chase
On 2015-01-17 22:18, Roy Smith wrote: > Tell me about it. I have an E-Trade ATM card. When I first got > it, I set it up with a 6 digit PIN. I was shocked to discover some > time later that it actually only looks at the first 4 digits. And, > no, I'm not talking *characters*, I'm talking *digit

Re: Hello World

2015-01-17 Thread Steven D'Aprano
Roy Smith wrote: > In article <54bb1c83$0$12979$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: > >> Even that doesn't protect you, because your security is controlled by >> websites and banks etc. with stupid security policies. E.g. I am forced >> to deal with one bank that uses

Re: Hello World

2015-01-17 Thread Roy Smith
In article <54bb1c83$0$12979$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > Even that doesn't protect you, because your security is controlled by > websites and banks etc. with stupid security policies. E.g. I am forced to > deal with one bank that uses a cryptographic key to sign

Re: numpy.allclose()

2015-01-17 Thread Steven D'Aprano
Ian Kelly wrote: > On Sat, Jan 17, 2015 at 7:26 AM, Steven D'Aprano > wrote: >> I don't understand why they add the error tolerances together. I can >> understand taking the minimum, or the maximum: > > The usual idea is that the tolerance is calculated as a relative > value, but an absolute tol

Re: lambdak: multi-line lambda implementation in native Python

2015-01-17 Thread Steven D'Aprano
Roy Smith wrote: > In article <54ba5a25$0$12991$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: > >> Whitespace is significant in nearly all programming languages, and so it >> should be. Whitespace separates tokens, and lines, and is a natural way >> of writing (at least for peop

Re: Hello World

2015-01-17 Thread Steven D'Aprano
Albert van der Horst wrote: > In article , wrote: >>Michael Torrie wrote: >>> On 01/17/2015 07:51 AM, Albert van der Horst wrote: >>> > In article , >>> > Chris Angelico wrote: >>> > >>> >> >>> >> But sure. If you want to cut out complication, dispense with user >>> >> accounts altogether an

Re: Hello World

2015-01-17 Thread Michael Torrie
On 01/17/2015 11:47 AM, Michael Ströder wrote: >> sudo makes administrators careless, lazy and it is not simple at all. > > Admins must have separate accounts with separate credentials for > administrative work and must be careful when using an administrative account. Right. This is not a bad id

Re: Hello World

2015-01-17 Thread Devin Jeanpierre
Sorry for necro. On Sat, Dec 20, 2014 at 10:44 PM, Chris Angelico wrote: > On Sun, Dec 21, 2014 at 5:31 PM, Terry Reedy wrote: >> Just to be clear, writing to sys.stdout works fine in Idle. > import sys; sys.stdout.write('hello ') >> hello #2.7 >> >> In 3.4, the number of chars? bytes? is r

Re: Hello World

2015-01-17 Thread Chris Angelico
On Sun, Jan 18, 2015 at 10:46 AM, Steven D'Aprano wrote: > The merely poor reason given by the more thoughtful sys admins is, if the > password hashes get stolen, the hacker has a maximum of N days (and > possibly less) to crack the hashes and recover the passwords before they > get changed. That'

Re: Hello World

2015-01-17 Thread Steven D'Aprano
Mark Lawrence wrote: > Bah humbug, this has reminded me of doing secure work whereby each > individual had two passwords, both of which had to be changed every > thirty days, and rules were enforced so you couldn't just increment the > number at the end of a word or similar. I hate and despise sy

Re: lambdak: multi-line lambda implementation in native Python

2015-01-17 Thread Gregory Ewing
Jussi Piitulainen wrote: I prefer parentheses. They are not nearly as fragile. So do I, but the other day I had occasion to write a small piece of VBScript, and I discovered that it actually *forbids* parens around the arguments to procedure calls (but not function calls). Fortunately, it requ

Re: Why do the URLs of posts here change?

2015-01-17 Thread Gregory Ewing
Albert van der Horst wrote: Knowing that the source is an mbox file, I don't need to follow that link to conclude that one is not very inventive. It suffices to replace the content of the message by a repetition of '\n'. Editing the mbox file isn't the problem. From what I gather, telling m

Re: lambdak: multi-line lambda implementation in native Python

2015-01-17 Thread Chris Angelico
On Sun, Jan 18, 2015 at 8:56 AM, Gregory Ewing wrote: > Ruby doesn't have that problem because it doesn't > have functions, only methods, and the only thing you > can do with a method in Ruby is call it. So functions aren't first-class objects in Ruby? Bleh. I've become quite accustomed to passin

Re: lambdak: multi-line lambda implementation in native Python

2015-01-17 Thread Gregory Ewing
Chris Angelico wrote: Every once in a while, someone looks at Py2's print statement and Py3's print function and says, "why not allow function calls without parentheses". This right here is why not. There's also the fact that the parens are needed to distinguish between calling a function and u

Re: lambdak: multi-line lambda implementation in native Python

2015-01-17 Thread Gregory Ewing
Steven D'Aprano wrote: def a(x=4) x+2 end a + b => 7 a+b => 7 a+ b => 7 a +b => 3 A shiny new penny for any non-Ruby coder who can explain that! Seems pretty obvious to me: the Ruby interpreter is infested with demons. DWIM = Demonic Whim Infers Meaning -- Greg -- https://mail.pyth

Re: recursive function: use a global or pass a parameter?

2015-01-17 Thread Gregory Ewing
Yawar Amin wrote: Cool ... but it looks like this can still potentially hit the max recursion limit? It depends on the nature of your data. If the data is a tree, it's very unlikely you'll reach the recursion limit unless the tree is massively unbalanced. If there's a chance of that, or if th

Re: recursive function: use a global or pass a parameter?

2015-01-17 Thread Gregory Ewing
Roy Smith wrote: I will commonly put something like: import logging logger = logging.getLogger("logger-name-for-my-module") But that's not really a global variable, it's a global constant. There's nothing wrong with those, we use them all the time -- classes, functions, etc. If you were to re

Re: lambdak: multi-line lambda implementation in native Python

2015-01-17 Thread alister
On Sat, 17 Jan 2015 19:08:21 +, Dan Sommers wrote: > On Sat, 17 Jan 2015 18:44:42 +, Grant Edwards wrote: > >> ... somebody who only knows how to write C++ [though he can do it in >> several different languages]. > > +1 QOTW (brilliant phrases in other threads are off topic and are > dis

Re: recursive function: use a global or pass a parameter?

2015-01-17 Thread Chris Angelico
On Sun, Jan 18, 2015 at 4:30 AM, Albert van der Horst wrote: > The proper technique is make the global local to the normal subroutine, > then make the subroutine with those parameters you don't want to see > also local to that subroutine. > E.g. > > def fib(n): > ' return the n-th Fibonacci nu

Re: lambdak: multi-line lambda implementation in native Python

2015-01-17 Thread Dan Sommers
On Sat, 17 Jan 2015 18:44:42 +, Grant Edwards wrote: > ... somebody who only knows how to write C++ [though he can do it in > several different languages]. +1 QOTW (brilliant phrases in other threads are off topic and are disqualified) I have also suffered through such maintenance, but I hav

Re: lambdak: multi-line lambda implementation in native Python

2015-01-17 Thread Grant Edwards
On 2015-01-17, Roy Smith wrote: > In article <54ba39e0$0$13008$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: > >> Every time I think I would like to learn a new language, I quite quickly run >> into some obvious feature that Python has but the newer language lacks, and >> I think

Re: Hello World

2015-01-17 Thread Michael Ströder
alb...@spenarnc.xs4all.nl (Albert van der Horst) wrote: > In article , wrote: >> Michael Torrie wrote: >>> On 01/17/2015 07:51 AM, Albert van der Horst wrote: In article , Chris Angelico wrote: > > But sure. If you want to cut out complication, dispense with user >

Re: lambdak: multi-line lambda implementation in native Python

2015-01-17 Thread Grant Edwards
On 2015-01-16, Gregory Ewing wrote: > We're really quite spoiled in Python-land. It's easy > to forget just *how* spoiled we are until you go back > and try to do something in one of the more primitive > languages... I had to do some work in PHP yesterday -- fixing up some code that was written

Re: numpy.allclose()

2015-01-17 Thread Ian Kelly
On Sat, Jan 17, 2015 at 7:26 AM, Steven D'Aprano wrote: > I don't understand why they add the error tolerances together. I can > understand taking the minimum, or the maximum: The usual idea is that the tolerance is calculated as a relative value, but an absolute tolerance is used instead when th

Re: lambdak: multi-line lambda implementation in native Python

2015-01-17 Thread alister
On Sat, 17 Jan 2015 21:33:19 +1100, Steven D'Aprano wrote: > Gregory Ewing wrote: > >> Marko Rauhamaa wrote: >>> Gregory Ewing : >>> If those are 24-bit RGB pixels, you could encode 3 characters in each pixel. >>> >>> Not since Python3. Characters are Unicode now so you'll need to >>> d

Re: Hello World

2015-01-17 Thread Mark Lawrence
On 17/01/2015 16:47, c...@isbd.net wrote: Michael Torrie wrote: On 01/17/2015 07:51 AM, Albert van der Horst wrote: In article , Chris Angelico wrote: But sure. If you want to cut out complication, dispense with user accounts altogether and run everything as root. That's WAY simpler! I

Re: Hello World

2015-01-17 Thread Albert van der Horst
In article , wrote: >Michael Torrie wrote: >> On 01/17/2015 07:51 AM, Albert van der Horst wrote: >> > In article , >> > Chris Angelico wrote: >> > >> >> >> >> But sure. If you want to cut out complication, dispense with user >> >> accounts altogether and run everything as root. That's WAY si

Re: recursive function: use a global or pass a parameter?

2015-01-17 Thread Albert van der Horst
In article <5e4ccec6-7a00-467d-8cf6-258ab0421...@googlegroups.com>, Tim wrote: >I have this type of situation and wonder if I should use a global >variable outside the recursive function instead of passing the updated >parameter through. > >I want to get a union of all the values that any 'things

Re: lambdak: multi-line lambda implementation in native Python

2015-01-17 Thread Roy Smith
In article <54ba5a25$0$12991$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > Whitespace is significant in nearly all programming languages, and so it > should be. Whitespace separates tokens, and lines, and is a natural way of > writing (at least for people using Western languages)

Re: lambdak: multi-line lambda implementation in native Python

2015-01-17 Thread Roy Smith
In article , Skip Montanaro wrote: > On Sat, Jan 17, 2015 at 5:59 AM, Jussi Piitulainen > wrote: > > How far do you want to go? Is "a b + c" the same as "a(b) + c" or the > > same as "a(b + c)"? > > I think there is only one practical interpretation, the one that all > shells I'm familiar wit

Re: lambdak: multi-line lambda implementation in native Python

2015-01-17 Thread Roy Smith
In article <54ba39e0$0$13008$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > Every time I think I would like to learn a new language, I quite quickly run > into some obvious feature that Python has but the newer language lacks, and > I think "bugger this for a game of soldiers" and

Re: Hello World

2015-01-17 Thread cl
Michael Torrie wrote: > On 01/17/2015 07:51 AM, Albert van der Horst wrote: > > In article , > > Chris Angelico wrote: > > > >> > >> But sure. If you want to cut out complication, dispense with user > >> accounts altogether and run everything as root. That's WAY simpler! > > > > I didn't excep

Re: Why do the URLs of posts here change?

2015-01-17 Thread Albert van der Horst
In article , Chris Angelico wrote: >On Sat, Jan 10, 2015 at 2:21 PM, Gregory Ewing > wrote: >> Skip Montanaro wrote: >>> >>> The way this is done, is >>> that the message is removed from the underlying mbox file, and the >>> archive regenerated. That changes the counter for every message after >>

Re: Hello World

2015-01-17 Thread Michael Torrie
On 01/17/2015 07:51 AM, Albert van der Horst wrote: > In article , > Chris Angelico wrote: > >> >> But sure. If you want to cut out complication, dispense with user >> accounts altogether and run everything as root. That's WAY simpler! > > I didn't except this strawman argument from you. > Of c

Re: Hello World

2015-01-17 Thread cl
Chris Angelico wrote: > On Sun, Jan 18, 2015 at 1:51 AM, Albert van der Horst > wrote: > > In article , > > Chris Angelico wrote: > > > >> > >>But sure. If you want to cut out complication, dispense with user > >>accounts altogether and run everything as root. That's WAY simpler! > > > > I did

Re: recursive function: use a global or pass a parameter?

2015-01-17 Thread Roy Smith
In article <54ba3654$0$13008$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > Good reasons for using global variables are few and far between. Just about > the only good reason for using global variables that I can think of is if > you have one or more settings/preference that get s

Re: Hello World

2015-01-17 Thread Albert van der Horst
In article , Chris Angelico wrote: >On Fri, Jan 9, 2015 at 4:02 AM, Steve Hayes wrote: >> On 08 Jan 2015 12:43:33 GMT, alb...@spenarnc.xs4all.nl (Albert van der Horst) >> wrote: >> >>>I don't trust sudo because it is too complicated. >>>(To the point that I removed it from my machine.) >>>I do >

Re: Hello World

2015-01-17 Thread Chris Angelico
On Sun, Jan 18, 2015 at 1:51 AM, Albert van der Horst wrote: > In article , > Chris Angelico wrote: > >> >>But sure. If you want to cut out complication, dispense with user >>accounts altogether and run everything as root. That's WAY simpler! > > I didn't except this strawman argument from you.

Re: Hello World

2015-01-17 Thread Albert van der Horst
In article , Chris Angelico wrote: > >But sure. If you want to cut out complication, dispense with user >accounts altogether and run everything as root. That's WAY simpler! I didn't except this strawman argument from you. Of course you need a distinction between doing system things as root, and

numpy.allclose()

2015-01-17 Thread Steven D'Aprano
Can anyone explain the rationale for numpy's allclose() semantics? help(allclose) says: allclose(a, b, rtol=1e-05, atol=1e-08) Returns True if two arrays are element-wise equal within a tolerance. The tolerance values are positive, typically very small numbers. The relative differe

Re: lambdak: multi-line lambda implementation in native Python

2015-01-17 Thread Danilo Coccia
Il 17/01/2015 12.07, Marko Rauhamaa ha scritto: > Jussi Piitulainen : > >> a+ b => 7 # a() + b >> a +b => 3 # a(+b) => a(b) => a(1) = 1 + 2 >> >> I'm not quite fond of such surprise in programming language syntax. > > Yes, whoever came up with the idea of whitespace having syntactic > sig

Re: lambdak: multi-line lambda implementation in native Python

2015-01-17 Thread Chris Angelico
On Sat, Jan 17, 2015 at 9:49 PM, Jussi Piitulainen wrote: > I've only seen small amounts of Ruby code on the net. The only way I > can make some sense of that is if it gets analyzed as follows, using > parentheses for calls: > > a + b => 7 # a() + b => a(4) + b => 4 + 2 + 1 > a+b => 7 # a()

Re: lambdak: multi-line lambda implementation in native Python

2015-01-17 Thread Jussi Piitulainen
Skip Montanaro writes: > On Sat, Jan 17, 2015 at 5:59 AM, Jussi Piitulainen wrote: > > How far do you want to go? Is "a b + c" the same as "a(b) + c" or > > the same as "a(b + c)"? > > I think there is only one practical interpretation, the one that all > shells I'm familiar with have adopted: >

Re: lambdak: multi-line lambda implementation in native Python

2015-01-17 Thread Jussi Piitulainen
Marko Rauhamaa writes: > Seriously, though, I hate the optional semicolon rules of JavaScript > and Go. I dread the day when GvR gets it in his head to allow this > syntax in Python: > >average_drop_rate = cumulative_drop_count / >observation_period > > (although, it could be defined

Re: lambdak: multi-line lambda implementation in native Python

2015-01-17 Thread Steven D'Aprano
Jussi Piitulainen wrote: > I've only seen small amounts of Ruby code on the net. The only way I > can make some sense of that is if it gets analyzed as follows, using > parentheses for calls: > > a + b => 7 # a() + b => a(4) + b => 4 + 2 + 1 > a+b => 7 # a() + b > a+ b => 7 # a() + b >

Re: lambdak: multi-line lambda implementation in native Python

2015-01-17 Thread Steven D'Aprano
Marko Rauhamaa wrote: > Jussi Piitulainen : > >> a+ b => 7 # a() + b >> a +b => 3 # a(+b) => a(b) => a(1) = 1 + 2 >> >> I'm not quite fond of such surprise in programming language syntax. > > Yes, whoever came up with the idea of whitespace having syntactic > significance! Yes, we shoul

Re: Comparisons and sorting of a numeric class....

2015-01-17 Thread Steven D'Aprano
Andrew, sorry for the delay in responding. Your response has been extremely long, so for the interest of brevity I've tried to trim things down to the most pertinent points. Andrew Robinson wrote: [...] > So -- From my perspective, Guido making Python go from an open ended and > permissive use of

Re: lambdak: multi-line lambda implementation in native Python

2015-01-17 Thread Marko Rauhamaa
Jussi Piitulainen : > Marko Rauhamaa writes: >> Yes, whoever came up with the idea of whitespace having syntactic >> significance! > > How far do you want to go? [...] > > I prefer parentheses. They are not nearly as fragile. *cough* braces *cough* Seriously, though, I hate the optional semicolo

Re: lambdak: multi-line lambda implementation in native Python

2015-01-17 Thread Skip Montanaro
On Sat, Jan 17, 2015 at 5:59 AM, Jussi Piitulainen wrote: > How far do you want to go? Is "a b + c" the same as "a(b) + c" or the > same as "a(b + c)"? I think there is only one practical interpretation, the one that all shells I'm familiar with have adopted: a(b, +, c) > And I don't reall

Re: lambdak: multi-line lambda implementation in native Python

2015-01-17 Thread Jussi Piitulainen
Marko Rauhamaa writes: > Jussi Piitulainen: > > > a+ b => 7 # a() + b > > a +b => 3 # a(+b) => a(b) => a(1) = 1 + 2 > > > > I'm not quite fond of such surprise in programming language > > syntax. > > Yes, whoever came up with the idea of whitespace having syntactic > significance! How fa

EuroPython 2015: Landing in Bilbao

2015-01-17 Thread M.-A. Lemburg
After a creative and inspiring Friday afternoon, we are pleased to announce our EuroPython 2015 landing page: http://ep2015.europython.eu/ This will be the URL for EuroPython 2015 - definitely worth a bookmark, we think :-) Enjoy, -— EuroPython Society (EPS) http://www.euro

Re: lambdak: multi-line lambda implementation in native Python

2015-01-17 Thread Marko Rauhamaa
Jussi Piitulainen : > a+ b => 7 # a() + b > a +b => 3 # a(+b) => a(b) => a(1) = 1 + 2 > > I'm not quite fond of such surprise in programming language syntax. Yes, whoever came up with the idea of whitespace having syntactic significance! Marko -- https://mail.python.org/mailman/listinf

Re: lambdak: multi-line lambda implementation in native Python

2015-01-17 Thread Jussi Piitulainen
Steven D'Aprano writes: > Ah, wait, I forgot Ruby's brilliant "feature" that whitespace > *between* expressions is significant: > > [steve@ando ~]$ cat ~/coding/ruby/ws-example.rb > #!/usr/bin/ruby > > def a(x=4) > x+2 > end > > b = 1 > print "a + b => ", (a + b), "\n" > print "a+b => ",

Re: lambdak: multi-line lambda implementation in native Python

2015-01-17 Thread Steven D'Aprano
Gregory Ewing wrote: > We're really quite spoiled in Python-land. It's easy > to forget just how spoiled we are until you go back > and try to do something in one of the more primitive > languages... Every time I think I would like to learn a new language, I quite quickly run into some obvious fe

Re: lambdak: multi-line lambda implementation in native Python

2015-01-17 Thread Steven D'Aprano
Gregory Ewing wrote: > Marko Rauhamaa wrote: >> Gregory Ewing : >> >>>If those are 24-bit RGB pixels, you could encode >>>3 characters in each pixel. >> >> Not since Python3. Characters are Unicode now so you'll need to dedicate >> a pixel for each character. > > Depends on which characters you

Re: recursive function: use a global or pass a parameter?

2015-01-17 Thread Steven D'Aprano
Tim wrote: > I have this type of situation and wonder if I should use a global variable > outside the recursive function instead of passing the updated parameter > through. To a first approximation, the answer to: "I have a X, should I use a global variable or a parameter?" is *always* "use a p