Re: Proposed new syntax

2017-08-18 Thread Steve D'Aprano
On Sat, 19 Aug 2017 12:59 am, Chris Angelico wrote: > On Fri, Aug 18, 2017 at 11:46 PM, Rustom Mody wrote: >> Compare the well-known haskell tutorial >> http://learnyouahaskell.com/starting-out >> whose comprehension intro starts: >> >> | If you've ever taken a course in mathematics, you've proba

Re: Default .py program and Edit with IDLE problem

2017-08-18 Thread Ben Iannitelli
Hi Kevi, Just to clarify your situation: 1. Which operating system? 2. You still have all of the .py files that you yourself wrote? Sincerely, -Ben I. -- https://mail.python.org/mailman/listinfo/python-list Python-list Info Page m

Re: A question on modification of a list via a function invocation

2017-08-18 Thread Steve D'Aprano
On Sat, 19 Aug 2017 12:43 am, Stefan Ram wrote: > Ben Bacarisse writes: >>Steve D'Aprano writes: >>>"Java is call by value, dammit!" >>I don't think this is a fair point. You will run out of ideas if they >>are to be avoided because some people will get the wrong idea when >>reading part of a d

Re: Proposed new syntax

2017-08-18 Thread Steve D'Aprano
On Fri, 18 Aug 2017 11:46 pm, Rustom Mody wrote: > My issue is that the tutorial introduces comprehensions backwards, as though > they are a macro for the for-loop Python doesn't have macros as such, but if it did, that would be a good way to describe comprehensions. Another way would be to say

Re: A question on modification of a list via a function invocation

2017-08-18 Thread Steve D'Aprano
On Fri, 18 Aug 2017 10:36 pm, Rustom Mody wrote: >> So what abstraction do you think call by object sharing is making, and in >> what way does it leak? > > Data Dependency — also called coupling — is generally considered to be > deleterious to software quality Excessive coupling. You cannot avoi

Re: Proposed new syntax

2017-08-18 Thread Steve D'Aprano
On Thu, 17 Aug 2017 03:54 pm, Marko Rauhamaa wrote: > Ben Finney : > >> The Python list comprehension syntax does not specify control flow. > > I understand your point, but how do you know your statement is true? > > I didn't check this, but I would imagine the list comprehension: > >[ f(x

Re: pip requirements file

2017-08-18 Thread Ethan Furman
On 08/07/2017 11:15 AM, Ethan Furman wrote: Light finally turned on. If requirements.txt has all my installed requirements, that would include any dependencies actually needed; so I specify --no-dependencies, then dependencies not listed in the requirements.txt file will not be installed. A

Re: What extended ASCII character set uses 0x9D?

2017-08-18 Thread John Nagle
On 08/17/2017 05:53 PM, Chris Angelico wrote: On Fri, Aug 18, 2017 at 10:30 AM, John Nagle wrote: On 08/17/2017 05:14 PM, John Nagle wrote: I'm cleaning up some data which has text description fields from multiple sources. A few more cases: bytearray(b'\xe5\x81ukasz zmywaczyk') This

Re: What extended ASCII character set uses 0x9D?

2017-08-18 Thread Piet van Oostrum
Marko Rauhamaa writes: > Chris Angelico : > >> Ohh. We have no evidence that uppercasing is going on here, and a >> naive ASCII upper-casing wouldn't produce 0x81 either - if it did, it >> would also convert 0x21 ("!") into 0x01 (SOH, a control character). So >> this one's still a mystery. > > BT

Re: A question on modification of a list via a function invocation

2017-08-18 Thread Ben Bacarisse
r...@zedat.fu-berlin.de (Stefan Ram) writes: > Ben Bacarisse writes: >>Steve D'Aprano writes: >>>"Java is call by value, dammit!" >>I don't think this is a fair point. You will run out of ideas if they >>are to be avoided because some people will get the wrong idea when >>reading part of a desc

Re: What extended ASCII character set uses 0x9D?

2017-08-18 Thread Random832
On Fri, Aug 18, 2017, at 03:39, Marko Rauhamaa wrote: > BTW, I was reading up on the history of ASCII control characters. Quite > fascinating. > > For example, have you ever wondered why DEL is the odd control character > out at the code point 127? The reason turns out to be paper punch tape. > By

Re: A question on modification of a list via a function invocation

2017-08-18 Thread Chris Angelico
On Sat, Aug 19, 2017 at 2:06 AM, Stefan Ram wrote: > Chris Angelico writes: >>Wrong. Your parameter always contains an object. Sometimes that object >>is an array, sometimes that object is null. Null is not the absence of >>an object, any more than zero is the absence of a number, or black is >>t

Re: A question on modification of a list via a function invocation

2017-08-18 Thread Chris Angelico
On Sat, Aug 19, 2017 at 1:42 AM, Stefan Ram wrote: > Chris Angelico writes: >>On Sat, Aug 19, 2017 at 12:43 AM, Stefan Ram wrote: >>>{ final java.lang.Object object = new java.lang.Object(); >>> java.lang.System.out.println( object ); } > ... >>

Re: Proposed new syntax

2017-08-18 Thread Chris Angelico
On Fri, Aug 18, 2017 at 11:46 PM, Rustom Mody wrote: > Compare the well-known haskell tutorial > http://learnyouahaskell.com/starting-out > whose comprehension intro starts: > > | If you've ever taken a course in mathematics, you've probably run into set > | comprehensions. They're normally used f

Re: A question on modification of a list via a function invocation

2017-08-18 Thread Chris Angelico
On Sat, Aug 19, 2017 at 12:43 AM, Stefan Ram wrote: > Ben Bacarisse writes: >>Steve D'Aprano writes: >>>"Java is call by value, dammit!" >>I don't think this is a fair point. You will run out of ideas if they >>are to be avoided because some people will get the wrong idea when >>reading part of

Re: A question on modification of a list via a function invocation

2017-08-18 Thread Grant Edwards
On 2017-08-17, Ben Bacarisse wrote: > What goes wrong when someone thinks of Python as passing by value but > the value of an expression is an object reference? What usually goes wrong is that people don't combined that thinking with an understanding of what the "=" operator does. -- Grant Edw

Re: A question on modification of a list via a function invocation

2017-08-18 Thread Ben Bacarisse
Steve D'Aprano writes: > On Thu, 17 Aug 2017 11:37 pm, Ben Bacarisse wrote: > >> What goes wrong when someone thinks of Python as passing by value but >> the value of an expression is an object reference? This seems to be a hot-button topic so I'd like to try to cool it off a bit. To in that sp

Re: Proposed new syntax

2017-08-18 Thread Rustom Mody
There is code and there are machines There are Turing machines and Universal Turing machines There are programs and there are programming languages There are (il)legal programs and best/worst (software engineering) practices As best as I can see most of us are talking of the respective latters abo

Re: A question on modification of a list via a function invocation

2017-08-18 Thread Rustom Mody
On Friday, August 18, 2017 at 8:37:43 AM UTC+5:30, Steve D'Aprano wrote: > On Thu, 17 Aug 2017 11:19 pm, Rustom Mody wrote: > > > What is called ‘call-by-object’ or ‘call-by-sharing’ etc is really an > > acknowledgement of the fact that parameter passing in the OO world along > > with > > permiss

Re: What extended ASCII character set uses 0x9D?

2017-08-18 Thread MRAB
On 2017-08-18 04:46, John Nagle wrote: On 08/17/2017 05:53 PM, Chris Angelico wrote:> On Fri, Aug 18, 2017 at 10:30 AM, John Nagle wrote: >> On 08/17/2017 05:14 PM, John Nagle wrote: >>> I'm cleaning up some data which has text description fields from >>> multiple sources. >> A few

Re: What extended ASCII character set uses 0x9D?

2017-08-18 Thread Chris Angelico
On Fri, Aug 18, 2017 at 5:39 PM, Marko Rauhamaa wrote: > Chris Angelico : > >> Ohh. We have no evidence that uppercasing is going on here, and a >> naive ASCII upper-casing wouldn't produce 0x81 either - if it did, it >> would also convert 0x21 ("!") into 0x01 (SOH, a control character). So >> thi

Re: What extended ASCII character set uses 0x9D?

2017-08-18 Thread Marko Rauhamaa
Chris Angelico : > Ohh. We have no evidence that uppercasing is going on here, and a > naive ASCII upper-casing wouldn't produce 0x81 either - if it did, it > would also convert 0x21 ("!") into 0x01 (SOH, a control character). So > this one's still a mystery. BTW, I was reading up on the history

Re: Proposed new syntax

2017-08-18 Thread Paul Rubin
Marko Rauhamaa writes: > The question is, is it bad style—or even an error—to rely on the > execution order of the comprehension loops? Bad style: IMO, yes, most of the time. I've made use of it at particular times. If it's done in an obscure way it at least deserves a code commment. Error: n

Re: Call a class A method from a class B instance? Do I miss something?

2017-08-18 Thread jfong
Rick Johnson at 2017/8/18 UTC+8 AM 11:43:06 wrote: > jf...@ms4.hinet.net wrote: > > I study some codes of a tutorial about tkinter > > > > [snip code] > > > > My question is that the object which was left by > > callit(self.demoenter_callback, tag) is a callit instance, > > and the method it calls

Re: What extended ASCII character set uses 0x9D?

2017-08-18 Thread Chris Angelico
On Fri, Aug 18, 2017 at 5:11 PM, Marko Rauhamaa wrote: > Chris Angelico : > >> On Fri, Aug 18, 2017 at 4:57 PM, Marko Rauhamaa wrote: >>> Chris Angelico : >>> On Fri, Aug 18, 2017 at 4:38 PM, Paul Rubin wrote: > John Nagle writes: >> Since, as someone pointed out, there was U

Re: Call a class A method from a class B instance? Do I miss something?

2017-08-18 Thread jfong
Ian於 2017年8月18日星期五 UTC+8上午10時41分44秒寫道: > On Thu, Aug 17, 2017 at 6:03 PM, wrote: > > I study some codes of a tutorial about tkinter > > (https://github.com/daleathan/widget-tour-py3) and can't figure out how it > > works. > > > > Below is the codes from its two major files: > >

Re: What extended ASCII character set uses 0x9D?

2017-08-18 Thread Marko Rauhamaa
Chris Angelico : > On Fri, Aug 18, 2017 at 4:57 PM, Marko Rauhamaa wrote: >> Chris Angelico : >> >>> On Fri, Aug 18, 2017 at 4:38 PM, Paul Rubin wrote: John Nagle writes: > Since, as someone pointed out, there was UTF-8 which had been > run through an ASCII-type lower casing algori

Re: What extended ASCII character set uses 0x9D?

2017-08-18 Thread Chris Angelico
On Fri, Aug 18, 2017 at 4:57 PM, Marko Rauhamaa wrote: > Chris Angelico : > >> On Fri, Aug 18, 2017 at 4:38 PM, Paul Rubin wrote: >>> John Nagle writes: Since, as someone pointed out, there was UTF-8 which had been run through an ASCII-type lower casing algorithm >>> >>> I spent a few

Re: What extended ASCII character set uses 0x9D?

2017-08-18 Thread Marko Rauhamaa
Chris Angelico : > On Fri, Aug 18, 2017 at 4:38 PM, Paul Rubin wrote: >> John Nagle writes: >>> Since, as someone pointed out, there was UTF-8 which had been >>> run through an ASCII-type lower casing algorithm >> >> I spent a few minutes figuring out if some of the mysterious 0x81's >> could be

Re: Proposed new syntax

2017-08-18 Thread Marko Rauhamaa
Paul Rubin : > Steve D'Aprano writes: >> For loops and comprehensions (in Python) are inherently procedural, > > Sure, and floating point arithmetic is inherently imprecise and > doesn't follow the associative laws for either addition or > multiplication. There are times when we have to be aware