Re: Old Man Yells At Cloud

2017-09-19 Thread Steven D'Aprano
On Tue, 19 Sep 2017 18:43:43 -0700, Rick Johnson wrote: > On Tuesday, September 19, 2017 at 12:55:14 PM UTC-5, Chris Angelico > wrote: >> On Wed, Sep 20, 2017 at 3:44 AM, Stefan Ram >> wrote: >> > Steve D'Aprano did *not* write [it was >> > edited/abbreviated by me - S. R.]: >> > |disadvantages:

Re: Old Man Yells At Cloud

2017-09-19 Thread Chris Angelico
On Wed, Sep 20, 2017 at 2:55 PM, Pavol Lisy wrote: > BTW if python would only bring "from __cleverness__ import > print_function" how many people would accept your reasons and use it? > And how many would rewrite old code? > > How many people would say something like: "Oh it is cool! Now I could >

Issues with python commands in windows powershell

2017-09-19 Thread Joey Steward
Hello, I've been having issues using basic python commands in windows powershell. I'm new to programming so just going off of online tutorials. Earlier I was unable to use pip to install Django (pip install Django), and came to this forum for help and someone was able to give me the correct comma

Re: [RELEASE] Python 3.6.3rc1 and 3.7.0a1 are now available for testing and more

2017-09-19 Thread Paul Rubin
Ned Deily writes: > You can find Python 3.7.0a1 and more information here: > https://www.python.org/downloads/release/python-370a1/ This says: The next pre-release of Python 3.7 will be 3.6.0a2, currently scheduled for 2016-10-16. :) -- https://mail.python.org/mailman/listinfo/pyth

Re: Old Man Yells At Cloud

2017-09-19 Thread Pavol Lisy
On 9/19/17, Steve D'Aprano wrote: [...] > The point is, we all make the occasional silly error. Doesn't mean we should > cripple our functions and fill the language with special cases like the > print > statement to avoid such rare errors. If print had always been a function, > and > someone sug

Greater and less than operators [was Re: [Tutor] beginning to code]

2017-09-19 Thread Steven D'Aprano
On Tue, 19 Sep 2017 17:26:55 -0700, Rick Johnson wrote: > Of course, allowing all objects to use the `==`, `!=` sugars makes > perfect sense, but `<`, `>`, `<=`, `>=` are meaningless outside of > numeric-ish types. You've never wanted to sort strings? How do you sort strings unless you have a c

Re: Old Man Yells At Cloud

2017-09-19 Thread MRAB
On 2017-09-20 01:41, Stefan Ram wrote: Steve D'Aprano writes: A simple "autocorrect" in *what*? The interpreter? The editor? Both? I imagine something like this: When the editor gets the command to run the contents of the buffer as Python, it would then do the autocorrect in the buff

Re: [Tutor] beginning to code

2017-09-19 Thread INADA Naoki
> > >>> False > 1 > False > >>> dir > 1 > True > >>> isinstance < 100 > False > >>> "" >= 10 > True > >>> (1,) <= 500 > False > > And down the rabbit hole we go! > > Now, not only do we have magic that implicitly casts all > objects to booleans in conditional

Re: Old Man Yells At Cloud

2017-09-19 Thread Ethan Furman
On 09/19/2017 09:37 AM, justin walters wrote: On Tue, Sep 19, 2017 at 9:17 AM, Grant Edwards wrote: On 2017-09-19, Jan Erik =?utf-8?q?Mostr=C3=B6m?= wrote: And I'm amazed how often I see people trying to calculate change = sum handed over - cost and then trying to figure out what bi

Re: Old Man Yells At Cloud

2017-09-19 Thread Rick Johnson
On Tuesday, September 19, 2017 at 1:31:52 PM UTC-5, bartc wrote: [...] > Can't you get around all those with things like > sys.stdout.write? Yes. > If so, what was the point of having a discrete print > statement/function at all? I believe the original intent was to create a universal symbo

Re: Old Man Yells At Cloud

2017-09-19 Thread Rick Johnson
On Tuesday, September 19, 2017 at 12:55:14 PM UTC-5, Chris Angelico wrote: > On Wed, Sep 20, 2017 at 3:44 AM, Stefan Ram wrote: > > Steve D'Aprano did *not* write > > [it was edited/abbreviated by me - S. R.]: > > |disadvantages: > > |0 - it makes print a special thing No more "special" than any

Re: [Tutor] beginning to code

2017-09-19 Thread Bill
Rick Johnson wrote: I think for most languages an intuitive syntax is not important -- C is such a language, Lisp is such a language, Perl is such a language, and there are many more -- but for Python, intuitiveness is very important. I guess it depends on what you mean by "important" ("importan

Re: Old Man Yells At Cloud

2017-09-19 Thread Rick Johnson
On Tuesday, September 19, 2017 at 2:08:05 AM UTC-5, Steven D'Aprano wrote: > [...] > 5.6775 is a much more useful answer than Fraction(2271, 400). ("What's > that in real money?") Steven, you're not using floats for currency are you? Tsk tsk! Besides, if Python division returned a useless frac

Re: [Tutor] beginning to code

2017-09-19 Thread Steve D'Aprano
On Wed, 20 Sep 2017 03:22 am, Chris Angelico wrote: > On Wed, Sep 20, 2017 at 2:20 AM, Steve D'Aprano > wrote: >> I can only think of four operations which are plausibly universal: >> >> Identity: compare two operands for identity. In this case, the type of the >> object is irrelevant. >> >> Kind

Re: Even Older Man Yells at Whippersnappers

2017-09-19 Thread Steve D'Aprano
On Wed, 20 Sep 2017 04:48 am, Larry Martell wrote: >>> It was my birthday the other day. People at worked asked how old I >>> was. I replied: >>> >>> ((3**2)+math.sqrt(400))*2 >>> >>> Quite a few people somehow came up with 47. And these are technical people. >> >> *headscratch* Multiple people go

Re: [Tutor] beginning to code

2017-09-19 Thread Rick Johnson
INADA Naoki wrote: > Rick Johnson wrote: > > INADA Naoki wrote: > > > > > > I can't agree with you. It's too redundant. It doesn't > > > provide any information about what coder think. > > > > It's not about what the "coder thinks", many times what > > the coder thinks is wrong, it's about writin

Re: Old Man Yells At Cloud

2017-09-19 Thread Steve D'Aprano
On Wed, 20 Sep 2017 04:31 am, bartc wrote: > On 19/09/2017 17:30, Steve D'Aprano wrote: [snip list of problems with print] > Can't you get around all those with things like sys.stdout.write? If you had kept reading, you would have seen that I wrote: Of course an experienced Python coder ca

Re: Old Man Yells At Cloud

2017-09-19 Thread Steve D'Aprano
On Wed, 20 Sep 2017 03:44 am, Stefan Ram wrote: > Steve D'Aprano did *not* write > [it was edited/abbreviated by me - S. R.]: > |disadvantages: > |0 - it makes print a special thing > |1 - beginners have to unlearn > |2 - `print(x, y)` is *not* the same as `print x, y`; > |3 - it has bizarre synt

Re: String to Dictionary conversion in python

2017-09-19 Thread sohcahtoa82
On Thursday, September 14, 2017 at 11:01:46 PM UTC-7, santosh.y...@gmail.com wrote: > Hi, > > Can anyone help me in the below issue. > > I need to convert string to dictionary > > string = " 'msisdn': '7382432382', 'action': 'select', 'sessionId': '123', > 'recipient': '7382432382', 'language

[RELEASE] Python 3.6.3rc1 and 3.7.0a1 are now available for testing and more

2017-09-19 Thread Ned Deily
The Python build factories have been busy the last several weeks preparing our fall lineup of releases. Today we are happy to announce three additions: 3.6.3rc1, 3.7.0a1, and 3.3.7 final, which join last weekend's 2.7.14 and last month's 3.5.4 bug-fix releases and 3.4.7 security-fix update (https:

Re: Even Older Man Yells at Whippersnappers

2017-09-19 Thread Gene Heskett
On Tuesday 19 September 2017 13:38:42 ROGER GRAYDON CHRISTMAN wrote: > I recall giving a quiz to my college students sometime back around > the late nineties which had a little bit of arithmetic involved in the > answer. It's been too long ago to still have the exact details, but I > remember a c

Re: Old Man Yells At Cloud

2017-09-19 Thread Chris Angelico
On Wed, Sep 20, 2017 at 5:45 AM, Stefan Ram wrote: > Chris Angelico writes: >>On Wed, Sep 20, 2017 at 4:59 AM, Stefan Ram wrote: >>>I don't get this. For example, the contractual payment (cost) is >>>47.21 >>>, the other party hands over >>>50.25 >>>. Now I am supposed to add /what/ to the cost?

Re: Issues with pip installation on windows

2017-09-19 Thread MRAB
On 2017-09-19 20:19, Bill Deegan wrote: try using: python -m pip Does that work? If you want to be more specific, you can use the Python launcher: py -3.6 -m pip On Tue, Sep 19, 2017 at 12:47 PM, Joey Steward wrote: -- Forwarded message -- From: Joey Steward Date: Mon,

Re: Even Older Man Yells At Whippersnappers

2017-09-19 Thread MRAB
On 2017-09-19 17:46, Larry Martell wrote: On Tue, Sep 19, 2017 at 12:12 PM, Rhodri James wrote: Eh, my school never 'ad an electronics class, nor a computer neither. Made programming a bit tricky; we 'ad to write programs on a form and send 'em off to next county. None of this new-fangled VHD

Re: Even Older Man Yells At Whippersnappers

2017-09-19 Thread MRAB
On 2017-09-19 19:15, Christopher Reimer wrote: On Sep 19, 2017, at 9:09 AM, justin walters wrote: On Tue, Sep 19, 2017 at 8:59 AM, Grant Edwards wrote: On 2017-09-19, Rhodri James wrote: On 19/09/17 16:00, Stefan Ram wrote: D'Arcy Cain writes: of course, I use calculators and computers b

Re: Old Man Yells At Cloud

2017-09-19 Thread Chris Angelico
On Wed, Sep 20, 2017 at 4:59 AM, Stefan Ram wrote: > "Jan Erik =?utf-8?q?Mostr=C3=B6m?=" writes: >>And I'm amazed how often I see people trying to calculate >>change = sum handed over - cost >>and then trying to figure out what bills/coins should be returned >>instead of doing the simple thing of

Re: Issues with pip installation on windows

2017-09-19 Thread Bill Deegan
try using: python -m pip Does that work? On Tue, Sep 19, 2017 at 12:47 PM, Joey Steward wrote: > -- Forwarded message -- > From: Joey Steward > Date: Mon, Sep 18, 2017 at 3:26 PM > Subject: Issues with pip installation on windows > To: python-list@python.org > > > Hello, > > I'

Re: Even Older Man Yells At Whippersnappers

2017-09-19 Thread Christopher Reimer
> On Sep 19, 2017, at 9:09 AM, justin walters > wrote: > > On Tue, Sep 19, 2017 at 8:59 AM, Grant Edwards > wrote: > >>> On 2017-09-19, Rhodri James wrote: On 19/09/17 16:00, Stefan Ram wrote: D'Arcy Cain writes: > of course, I use calculators and computers but I still understa

Re: Old Man Yells At Cloud

2017-09-19 Thread bartc
On 19/09/2017 17:26, Larry Martell wrote: On Tue, Sep 19, 2017 at 10:30 AM, D'Arcy Cain wrote: On 09/19/2017 06:46 AM, Larry Martell wrote: True story - the other day I was in a store and my total was $10.12. I One time I was at a cash with three or four items which were taxable. The cashi

Re: Stdlib, what's in, what's out

2017-09-19 Thread John Ladasky
On Tuesday, September 19, 2017 at 1:05:51 AM UTC-7, Stefan Behnel wrote: > John Ladasky schrieb am 19.09.2017 um 08:54: > > I have come to understand from your other posts that adding something to > > the stdlib imposes significant constraints on the release schedules of > > those modules. I can a

Re: Even Older Man Yells At Whippersnappers

2017-09-19 Thread Larry Martell
On Tue, Sep 19, 2017 at 12:12 PM, Rhodri James wrote: > > Eh, my school never 'ad an electronics class, nor a computer neither. Made > programming a bit tricky; we 'ad to write programs on a form and send 'em > off to next county. None of this new-fangled VHDL neither, we 'ad to do our > simulat

Fwd: Issues with pip installation on windows

2017-09-19 Thread Joey Steward
-- Forwarded message -- From: Joey Steward Date: Mon, Sep 18, 2017 at 3:26 PM Subject: Issues with pip installation on windows To: python-list@python.org Hello, I'm a new programmer who initially began learning python for bioinformatics and data analysis applications, but have r

Re: Old Man Yells At Cloud

2017-09-19 Thread justin walters
On Tue, Sep 19, 2017 at 9:26 AM, Larry Martell wrote: > On Tue, Sep 19, 2017 at 10:30 AM, D'Arcy Cain > wrote: > > On 09/19/2017 06:46 AM, Larry Martell wrote: > >> > >> True story - the other day I was in a store and my total was $10.12. I > > > > > > One time I was at a cash with three or four

Re: Old Man Yells At Cloud

2017-09-19 Thread Grant Edwards
On 2017-09-19, Larry Martell wrote: > I was just in a clothing store this weekend and there was a rack of > clothes that was 50%. The sales clerk said everything on that rack was > an additional 25% off, so it's 75% off the original price. I asked is > it 75% off the original price or 25% off the

Re: Even Older Man Yells at Whippersnappers

2017-09-19 Thread Larry Martell
On Tue, Sep 19, 2017 at 2:41 PM, Chris Angelico wrote: > On Wed, Sep 20, 2017 at 4:33 AM, Larry Martell > wrote: >> On Tue, Sep 19, 2017 at 1:38 PM, ROGER GRAYDON CHRISTMAN >> wrote: >>> I recall giving a quiz to my college students sometime back around >>> the late nineties which had a littl

Re: Even Older Man Yells at Whippersnappers

2017-09-19 Thread Rhodri James
On 19/09/17 19:33, Larry Martell wrote: On Tue, Sep 19, 2017 at 1:38 PM, ROGER GRAYDON CHRISTMAN wrote: I recall giving a quiz to my college students sometime back around the late nineties which had a little bit of arithmetic involved in the answer. It's been too long ago to still have the ex

Re: Even Older Man Yells at Whippersnappers

2017-09-19 Thread Chris Angelico
On Wed, Sep 20, 2017 at 4:33 AM, Larry Martell wrote: > On Tue, Sep 19, 2017 at 1:38 PM, ROGER GRAYDON CHRISTMAN wrote: >> I recall giving a quiz to my college students sometime back around >> the late nineties which had a little bit of arithmetic involved in the >> answer. >> It's been too lon

Re: Old Man Yells At Cloud

2017-09-19 Thread bartc
On 19/09/2017 17:30, Steve D'Aprano wrote: On Tue, 19 Sep 2017 05:56 am, Roel Schroeven wrote: I do prefer Python 3's print-as-a-function because "special cases aren't special enough to break the rules", but I feel there's a case to be made for Python 2's print-as-a-statement because "(altho

Re: Research paper "Energy Efficiency across Programming Languages: How does energy, time, and memory relate?"

2017-09-19 Thread leam hall
On Tue, Sep 19, 2017 at 2:37 PM, Stephan Houben < stephan...@gmail.com.invalid> wrote: > Op 2017-09-19, Steven D'Aprano schreef pearwood.info>: > > > There is a significant chunk of the Python community for whom "just pip > > install it" is not easy, legal or even possible. For them, if its not i

Re: Research paper "Energy Efficiency across Programming Languages: How does energy, time, and memory relate?"

2017-09-19 Thread Stephan Houben
Op 2017-09-19, Steven D'Aprano schreef : > There is a significant chunk of the Python community for whom "just pip > install it" is not easy, legal or even possible. For them, if its not in > the standard library, it might as well not even exist. But numpy *is* in the standard library, provided

Re: Even Older Man Yells at Whippersnappers

2017-09-19 Thread Larry Martell
On Tue, Sep 19, 2017 at 1:38 PM, ROGER GRAYDON CHRISTMAN wrote: > I recall giving a quiz to my college students sometime back around > the late nineties which had a little bit of arithmetic involved in the answer. > It's been too long ago to still have the exact details, but I remember > a couple

Re: Even Older Man Yells At Whippersnappers

2017-09-19 Thread Rhodri James
On 19/09/17 17:52, justin walters wrote: On Tue, Sep 19, 2017 at 9:12 AM, Rhodri James wrote: Eh, my school never 'ad an electronics class, nor a computer neither. Made programming a bit tricky; we 'ad to write programs on a form and send 'em off to next county. None of this new-fangled VHDL

Re: Even Older Man Yells at Whippersnappers

2017-09-19 Thread ROGER GRAYDON CHRISTMAN
I recall giving a quiz to my college students sometime back around the late nineties which had a little bit of arithmetic involved in the answer. It's been too long ago to still have the exact details, but I remember a couple solutions that would be of the form: 5 + 10 + 1*2 And then the student

Re: Old Man Yells At Cloud

2017-09-19 Thread Chris Angelico
On Wed, Sep 20, 2017 at 3:44 AM, Stefan Ram wrote: > Steve D'Aprano did *not* write > [it was edited/abbreviated by me - S. R.]: > |disadvantages: > |0 - it makes print a special thing > |1 - beginners have to unlearn > |2 - `print(x, y)` is *not* the same as `print x, y`; > |3 - it has bizarre s

Re: [Tutor] beginning to code

2017-09-19 Thread Chris Angelico
On Wed, Sep 20, 2017 at 2:20 AM, Steve D'Aprano wrote: > I can only think of four operations which are plausibly universal: > > Identity: compare two operands for identity. In this case, the type of the > object is irrelevant. > > Kind: interrogate an object to find out what kind of thing it is (w

Re: Even Older Man Yells At Whippersnappers

2017-09-19 Thread justin walters
On Tue, Sep 19, 2017 at 9:12 AM, Rhodri James wrote: > On 19/09/17 16:59, Grant Edwards wrote: > >> On 2017-09-19, Rhodri James wrote: >> >>> On 19/09/17 16:00, Stefan Ram wrote: >>> D'Arcy Cain writes: > of course, I use calculators and computers but I still understand the >

Re: Even Older Man Yells At Whippersnappers

2017-09-19 Thread Stefan Behnel
Stefan Ram schrieb am 19.09.2017 um 17:00: > D'Arcy Cain writes: >> of course, I use calculators and computers but I still understand the >> theory behind what I am doing. > > I started out programming in BASIC. Today, I use Python, > the BASIC of the 21st century. Python has no GOTO, but wh

Re: Even Older Man Yells At Whippersnappers

2017-09-19 Thread Rhodri James
On 19/09/17 16:59, Grant Edwards wrote: On 2017-09-19, Rhodri James wrote: On 19/09/17 16:00, Stefan Ram wrote: D'Arcy Cain writes: of course, I use calculators and computers but I still understand the theory behind what I am doing. I started out programming in BASIC. Today, I use Pyth

Re: Old Man Yells At Cloud

2017-09-19 Thread Steve D'Aprano
On Tue, 19 Sep 2017 05:56 am, Roel Schroeven wrote: > I do prefer Python 3's print-as-a-function because "special cases aren't > special enough to break the rules", but I feel there's a case to be made > for Python 2's print-as-a-statement because "(although) practicality > beats purity" sometim

Re: Old Man Yells At Cloud

2017-09-19 Thread justin walters
On Tue, Sep 19, 2017 at 9:17 AM, Grant Edwards wrote: > On 2017-09-19, Jan Erik =?utf-8?q?Mostr=C3=B6m?= > wrote: > > > And I'm amazed how often I see people trying to calculate > > > > change = sum handed over - cost > > > > and then trying to figure out what bills/coins should be returned

Re: Old Man Yells At Cloud

2017-09-19 Thread Larry Martell
On Tue, Sep 19, 2017 at 10:30 AM, D'Arcy Cain wrote: > On 09/19/2017 06:46 AM, Larry Martell wrote: >> >> True story - the other day I was in a store and my total was $10.12. I > > > One time I was at a cash with three or four items which were taxable. The > cashier rung each one up and hit the to

Re: [Tutor] beginning to code

2017-09-19 Thread Steve D'Aprano
On Tue, 19 Sep 2017 09:53 pm, Rustom Mody wrote: > How exceptional is python's choice to NOT raise exceptions can be seen by > examples: You demonstrated that python raises exceptions for operations that aren't defined or meaningful. I don't know what point you think that made, apart from demonst

Re: Old Man Yells At Cloud

2017-09-19 Thread Grant Edwards
On 2017-09-19, Jan Erik =?utf-8?q?Mostr=C3=B6m?= wrote: > And I'm amazed how often I see people trying to calculate > > change = sum handed over - cost > > and then trying to figure out what bills/coins should be returned > instead of doing the simple thing of just adding to the cost. When

Re: Even Older Man Yells At Whippersnappers

2017-09-19 Thread justin walters
On Tue, Sep 19, 2017 at 8:59 AM, Grant Edwards wrote: > On 2017-09-19, Rhodri James wrote: > > On 19/09/17 16:00, Stefan Ram wrote: > >> D'Arcy Cain writes: > >>> of course, I use calculators and computers but I still understand the > >>> theory behind what I am doing. > >> > >>I started ou

Re: Old Man Yells At Cloud

2017-09-19 Thread D'Arcy Cain
On 09/19/2017 06:46 AM, Larry Martell wrote: True story - the other day I was in a store and my total was $10.12. I One time I was at a cash with three or four items which were taxable. The cashier rung each one up and hit the total button. She turned to me and said something like "$23.42 pl

Re: Old Man Yells At Cloud

2017-09-19 Thread Rhodri James
On 18/09/17 16:29, Ben Bacarisse wrote: Steve D'Aprano writes: To answer your question, what do I mean by int/int being undefined, I'd have to dig into areas of maths that either weren't taught in the undergrad courses I did, or that I've long since forgotten about. Something about... fields?

Re: Old Man Yells At Cloud

2017-09-19 Thread Jan Erik Moström
On 19 Sep 2017, at 13:01, bartc wrote: My bill in a store came to £3.20 (GBP3.20), so I handed over £10.20. I was given back £16.90 in change! It turned out the cashier had entered £20.10 as the amount tendered. It was sorted out in the end. Sometimes its easier not to be bother making the

Re: Even Older Man Yells At Whippersnappers

2017-09-19 Thread Grant Edwards
On 2017-09-19, Rhodri James wrote: > On 19/09/17 16:00, Stefan Ram wrote: >> D'Arcy Cain writes: >>> of course, I use calculators and computers but I still understand the >>> theory behind what I am doing. >> >>I started out programming in BASIC. Today, I use Python, >>the BASIC of the 2

Re: Even Older Man Yells At Whippersnappers

2017-09-19 Thread justin walters
On Tue, Sep 19, 2017 at 8:00 AM, Stefan Ram wrote: > D'Arcy Cain writes: > >of course, I use calculators and computers but I still understand the > >theory behind what I am doing. > > I started out programming in BASIC. Today, I use Python, > the BASIC of the 21st century. Python has no GOTO

Re: Even Older Man Yells At Whippersnappers

2017-09-19 Thread Rhodri James
On 19/09/17 16:00, Stefan Ram wrote: D'Arcy Cain writes: of course, I use calculators and computers but I still understand the theory behind what I am doing. I started out programming in BASIC. Today, I use Python, the BASIC of the 21st century. Python has no GOTO, but when it is exe

Re: Even Older Man Yells At Whippersnappers

2017-09-19 Thread Chris Angelico
On Wed, Sep 20, 2017 at 12:24 AM, D'Arcy Cain wrote: > On 09/19/2017 03:07 AM, Steven D'Aprano wrote: >>> >>> How relevant is the "people use calculators to do arithmetic" argument >>> today? Okay, so I'm old and cynical, but I know [young] people who >>> don't (can't?) calculate a gratuity witho

How to share class relationship representations?

2017-09-19 Thread leam hall
I'm working on designing the classes, sub-classes, and relationships in my code. What is a good visual way to represent it so it can be stored in git and shared on the list without large images or attachments? Thanks! Leam -- https://mail.python.org/mailman/listinfo/python-list

Even Older Man Yells At Whippersnappers

2017-09-19 Thread D'Arcy Cain
On 09/19/2017 03:07 AM, Steven D'Aprano wrote: How relevant is the "people use calculators to do arithmetic" argument today? Okay, so I'm old and cynical, but I know [young] people who don't (can't?) calculate a gratuity without an app or a web page. Which is a form of calculator. People still

Re: [Tutor] beginning to code

2017-09-19 Thread Rustom Mody
On Tuesday, September 19, 2017 at 4:41:01 PM UTC+5:30, Antoon Pardon wrote: > Op 19-09-17 om 11:22 schreef Steven D'Aprano: > > Except for bools, where people freak out and are convinced the world will > > end if you just ask an object "are you true or false?". > > > > Perhaps just a *tiny* exagg

Re: Old Man Yells At Cloud

2017-09-19 Thread Frank Millman
"bartc" wrote in message news:EN6wB.770830$uh.63078@fx28.am4... On 19/09/2017 11:46, Larry Martell wrote: > > True story - the other day I was in a store and my total was $10.12. I > pulled out a $20, and the cashier (probably age 23 or so) immediately > entered $20 as the amount tendered. Then

Re: [Tutor] beginning to code

2017-09-19 Thread Antoon Pardon
Op 19-09-17 om 11:22 schreef Steven D'Aprano: > On Tue, 19 Sep 2017 09:10:04 +0200, Antoon Pardon wrote: > >> Op 18-09-17 om 15:47 schreef Paul Moore: >>> On 18 September 2017 at 14:30, Antoon Pardon >>> wrote: Well that you reduce an object to a boolean value is not obvious to begin wit

Re: Old Man Yells At Cloud

2017-09-19 Thread bartc
On 19/09/2017 11:46, Larry Martell wrote: On Mon, Sep 18, 2017 at 11:23 PM, Dan Sommers wrote: How relevant is the "people use calculators to do arithmetic" argument today? Okay, so I'm old and cynical, but I know [young] people who don't (can't?) calculate a gratuity without an app or a web p

Re: Old Man Yells At Cloud

2017-09-19 Thread Larry Martell
On Mon, Sep 18, 2017 at 11:23 PM, Dan Sommers wrote: > How relevant is the "people use calculators to do arithmetic" argument > today? Okay, so I'm old and cynical, but I know [young] people who > don't (can't?) calculate a gratuity without an app or a web page. I use a calculator all the time -

Re: Old Man Yells At Cloud

2017-09-19 Thread Chris Angelico
On Tue, Sep 19, 2017 at 7:31 PM, Steven D'Aprano wrote: > On Tue, 19 Sep 2017 17:59:10 +1000, Chris Angelico wrote: > >> Aside from the backward compatibility concerns (which mean that this >> can't be done in a language that calls itself "Python"), I'm not seeing >> any reason that a human-friend

Re: [Tutor] beginning to code

2017-09-19 Thread Chris Angelico
On Tue, Sep 19, 2017 at 7:34 PM, Steven D'Aprano wrote: > On Tue, 19 Sep 2017 17:46:32 +1000, Chris Angelico wrote: > > >> # Display booleans differently if x is True: >> ... display flag >> else: >> ... display number >> >> which would be better represented with "if isinstance(x, bool):"

Re: Old Man Yells At Cloud

2017-09-19 Thread Steven D'Aprano
On Tue, 19 Sep 2017 17:59:10 +1000, Chris Angelico wrote: > Aside from the backward compatibility concerns (which mean that this > can't be done in a language that calls itself "Python"), I'm not seeing > any reason that a human-friendly language can't spend most of its time > working with arbitra

Re: [Tutor] beginning to code

2017-09-19 Thread Steven D'Aprano
On Tue, 19 Sep 2017 17:46:32 +1000, Chris Angelico wrote: > # Display booleans differently if x is True: > ... display flag > else: > ... display number > > which would be better represented with "if isinstance(x, bool):" Given that True is a singleton, it is redundant to write if isin

Re: [Tutor] beginning to code

2017-09-19 Thread Steven D'Aprano
On Tue, 19 Sep 2017 09:22:21 +0200, Antoon Pardon wrote: > But the problem is that the following two pieces of code don't do the > same in Python. > > if x: pass > if x is True: pass > > Sometimes I need that second statement "Need" is a funny thing. If all you are doing is testing the truthi

Re: [Tutor] beginning to code

2017-09-19 Thread Chris Angelico
On Tue, Sep 19, 2017 at 7:21 PM, Antoon Pardon wrote: > Op 19-09-17 om 09:46 schreef Chris Angelico: >> On Tue, Sep 19, 2017 at 5:22 PM, Antoon Pardon wrote: >>> But the problem is that the following two pieces of code don't do >>> the same in Python. >>> >>> if x: pass >>> if x is True: pass >>>

Re: [Tutor] beginning to code

2017-09-19 Thread Steven D'Aprano
On Tue, 19 Sep 2017 09:10:04 +0200, Antoon Pardon wrote: > Op 18-09-17 om 15:47 schreef Paul Moore: >> On 18 September 2017 at 14:30, Antoon Pardon >> wrote: >>> Well that you reduce an object to a boolean value is not obvious to >>> begin with. A TypeError because you are treating a non-boolean

Re: [Tutor] beginning to code

2017-09-19 Thread Antoon Pardon
Op 19-09-17 om 09:46 schreef Chris Angelico: > On Tue, Sep 19, 2017 at 5:22 PM, Antoon Pardon wrote: >> But the problem is that the following two pieces of code don't do >> the same in Python. >> >> if x: pass >> if x is True: pass >> > ... > > which would be better represented with "if isinstance

Re: [Tutor] beginning to code

2017-09-19 Thread Antoon Pardon
Op 19-09-17 om 09:40 schreef Chris Angelico: > On Tue, Sep 19, 2017 at 5:10 PM, Antoon Pardon wrote: > >> I don't find it really usefull. How useful is it that you can type >> if a: instead of if a != 0: ? I have yet to encounter a situation >> where I thought: Yes I want to execute this piece of

Re: Stdlib, what's in, what's out

2017-09-19 Thread Tim Golden
On 19/09/2017 09:05, Stefan Behnel wrote: The stdlib is there to provide a base level of functionality. That base level tends to be much higher up than in most other programming languages, but from the point of view of Python, it's still just a base level, however comfortable it might be. If you

Re: Stdlib, what's in, what's out

2017-09-19 Thread Stefan Behnel
John Ladasky schrieb am 19.09.2017 um 08:54: > I have come to understand from your other posts that adding something to > the stdlib imposes significant constraints on the release schedules of > those modules. I can appreciate the hassle that might cause. Still, > now I wonder what I might be mis

Re: Old Man Yells At Cloud

2017-09-19 Thread Chris Angelico
On Tue, Sep 19, 2017 at 5:07 PM, Steven D'Aprano wrote: > On Tue, 19 Sep 2017 03:23:15 +, Dan Sommers wrote: > >> On Tue, 19 Sep 2017 01:56:29 +, Stefan Ram wrote: >> >>> Steve D'Aprano writes: >> It is true that binary floats have some unexpected properties. They aren't the real

Re: [Tutor] beginning to code

2017-09-19 Thread Chris Angelico
On Tue, Sep 19, 2017 at 5:22 PM, Antoon Pardon wrote: > But the problem is that the following two pieces of code don't do > the same in Python. > > if x: pass > if x is True: pass > > Sometimes I need that second statement but I can be sure that > should I show a piece of code on this mailing list

Re: [Tutor] beginning to code

2017-09-19 Thread Chris Angelico
On Tue, Sep 19, 2017 at 5:10 PM, Antoon Pardon wrote: > Op 18-09-17 om 15:47 schreef Paul Moore: >> On 18 September 2017 at 14:30, Antoon Pardon wrote: >>> Well that you reduce an object to a boolean value is not obvious to >>> begin with. A TypeError because you are treating a non-boolean as >>>

Re: [Tutor] beginning to code

2017-09-19 Thread Antoon Pardon
Op 18-09-17 om 15:58 schreef Chris Angelico: > On Mon, Sep 18, 2017 at 11:30 PM, Antoon Pardon wrote: > >> Well that you reduce an object to a boolean value is not obvious to >> begin with. A TypeError because you are treating a non-boolean as >> a boolean would have been more obvious to me. > Sur

Re: Research paper "Energy Efficiency across Programming Languages: How does energy, time, and memory relate?"

2017-09-19 Thread Steven D'Aprano
On Tue, 19 Sep 2017 01:13:23 +0100, MRAB wrote: > I even have it on a Raspberry Pi. "pip install regex" is all it took. No > need for it to be in the stdlib. :-) That's fine for those of us who can run pip and install software from the web without being immediately fired, and for those who have

Re: Old Man Yells At Cloud

2017-09-19 Thread Steven D'Aprano
On Tue, 19 Sep 2017 03:23:15 +, Dan Sommers wrote: > On Tue, 19 Sep 2017 01:56:29 +, Stefan Ram wrote: > >> Steve D'Aprano writes: > >>>It is true that binary floats have some unexpected properties. They >>>aren't the real numbers that we learn in maths. But most people who >>>have been

Re: [Tutor] beginning to code

2017-09-19 Thread Antoon Pardon
Op 18-09-17 om 15:47 schreef Paul Moore: > On 18 September 2017 at 14:30, Antoon Pardon wrote: >> Well that you reduce an object to a boolean value is not obvious to >> begin with. A TypeError because you are treating a non-boolean as >> a boolean would have been more obvious to me. > More obvious