[Python-ideas] Python Reviewed

2017-01-09 Thread Simon Lovell
Python Reviewed Having used a lot of languages a little bit and not finding satisfactory answers to these in some cases often asked questions, I thought I'd join this group to make a post on the virtues and otherwise of python. The Good: Syntactically significant new lines Syntactical

Re: [Python-ideas] Python Reviewed

2017-01-09 Thread Chris Angelico
On Mon, Jan 9, 2017 at 10:25 PM, Simon Lovell wrote: > Python Reviewed > > Having used a lot of languages a little bit and not finding satisfactory > answers to these in some cases often asked questions, I thought I'd join > this group to make a post on the virtues and otherwise of python. I thin

Re: [Python-ideas] Python reviewed

2017-01-09 Thread Simon Lovell
Hmm, Thanks Chris. I thought I was posting this to the correct place. I've never seen that "for line in open ..." after googling it many times! Why is this question so often asked then? Re:Indentation making end block markers not needed; well yes they aren't /needed/. However, they are usefu

Re: [Python-ideas] Python reviewed

2017-01-09 Thread Matthias Bussonnier
On Mon, Jan 9, 2017 at 2:50 PM, Simon Lovell wrote: > Hmm, Thanks Chris. I thought I was posting this to the correct place. > > I've never seen that "for line in open ..." after googling it many times! > Why is this question so often asked then? > The distinction and the explanation of this is th

Re: [Python-ideas] PEP 540: Add a new UTF-8 mode

2017-01-09 Thread Barry Warsaw
On Jan 06, 2017, at 11:08 PM, Steve Dower wrote: >Passing universal_newlines will use whatever locale.getdefaultencoding() There is no locale.getdefaultencoding(); I think you mean locale.getpreferredencoding(False). (See the "Changed in version 3.3" note in $17.5.1.1 of the stdlib docs.) >univ

Re: [Python-ideas] PEP 540: Add a new UTF-8 mode

2017-01-09 Thread Stephen J. Turnbull
INADA Naoki writes: > But when I see non UTF-8 text, I don't change locale to read such > text. Nobody does. The problem is if people have locales set for non-UTF-8, which Chinese people often do ("GB18030 isn't just a good idea, it's the law"). Especially forcing stdout to something other tha

Re: [Python-ideas] Python reviewed

2017-01-09 Thread Stephen J. Turnbull
Simon Lovell writes: > Hmm, Thanks Chris. I thought I was posting this to the correct > place. Well, you didn't actually make any specific suggestions, and you describe it as a "review" rather than an RFE. > I've never seen that "for line in open ..." after googling it many > times! Why is

Re: [Python-ideas] PEP 540: Add a new UTF-8 mode

2017-01-09 Thread Stephan Houben
Hi Stephen, 2017-01-09 19:42 GMT+01:00 Stephen J. Turnbull < [email protected]>: > > Private sector may be up to date, but academic sector > (and from the state of e-stat.go.jp, government in general, I suspect) > is stuck in the Jomon era. > I went to that page, checked the HTM

Re: [Python-ideas] PEP 540: Add a new UTF-8 mode

2017-01-09 Thread INADA Naoki
> > The problem is if people have locales set for non-UTF-8, which Chinese > people often do ("GB18030 isn't just a good idea, it's the law"). > Especially forcing stdout to something other than the locale is likely > to mess things up. Oh, I didn't know non-UTF-8 is used for LC_CTYPE in these yea

Re: [Python-ideas] Python Reviewed

2017-01-09 Thread Steven D'Aprano
On Mon, Jan 09, 2017 at 07:25:45PM +0800, Simon Lovell wrote: > The Good: > Syntactically significant new lines > Syntactically significant indenting > Different types of array like structures for different situations > Mostly simple and clear structures > Avoiding implicit str

Re: [Python-ideas] Python Reviewed

2017-01-09 Thread Chris Kaynor
On Mon, Jan 9, 2017 at 11:40 AM, Steven D'Aprano wrote: > On Mon, Jan 09, 2017 at 07:25:45PM +0800, Simon Lovell wrote: >> Lack of a with statement which only obscures the code >Python has a `with` statement. I suspect Simon means similar to the VB with statement, which allows an object to be

Re: [Python-ideas] Python Reviewed

2017-01-09 Thread Ned Batchelder
On 1/9/17 8:31 AM, Chris Angelico wrote: > On Mon, Jan 9, 2017 at 10:25 PM, Simon Lovell wrote: >> Python Reviewed >> >> Having used a lot of languages a little bit and not finding satisfactory >> answers to these in some cases often asked questions, I thought I'd join >> this group to make a pos

Re: [Python-ideas] Python Reviewed

2017-01-09 Thread Mikhail V
On 9 January 2017 at 12:25, Simon Lovell wrote: > Python Reviewed > > The Good : > ... > The Bad: > ... I agree with many points, but: > No end required for if/while/for blocks. .. Makes the code less readable Nope, it makes code significantly better readable. I'm sort of past master in such q

Re: [Python-ideas] Python Reviewed

2017-01-09 Thread Steven D'Aprano
On Tue, Jan 10, 2017 at 06:40:34AM +1100, Steven D'Aprano wrote: > particularly when you appear to know the language very well? Of course I mean "don't appear". -- Steve ___ Python-ideas mailing list [email protected] https://mail.python.org/ma

Re: [Python-ideas] Python reviewed

2017-01-09 Thread Simon Lovell
Thanks for the feedback guys. A few quick comments: Re: Colons. I'm sure I've seen that FAQ before. I may be arrogant but I can't take it seriously. Being "slightly" easier to read is hardly a reason for a mandatory structure. Re: PEP249. I thought I'd detailed quite a bit of what I thought s

Re: [Python-ideas] Python reviewed

2017-01-09 Thread Chris Barker
not even sure why Im engaging, but Note 1) Many of these issues have been widely discussed all over the internet -- I don't think I've seen anything new here. So it would have been nice to do some more research before posting. Now into the fray! > Re:Everything being true of false. I don't

Re: [Python-ideas] Python reviewed

2017-01-09 Thread Alexander Belopolsky
On Mon, Jan 9, 2017 at 8:12 PM, Simon Lovell wrote: > Re: Colons. I'm sure I've seen that FAQ before. I may be arrogant but I > can't take it seriously. Being "slightly" easier to read is hardly a reason > for a mandatory structure. > "Readability counts." Did you notice that you placed a redun

Re: [Python-ideas] Python reviewed

2017-01-09 Thread Chris Barker
On Mon, Jan 9, 2017 at 5:12 PM, Simon Lovell wrote: > Re: Counters starting at zero vs one, Fortran has a neat solution to this > for arrays if not strings - allow the programmer to select the starting > index. I liked that back in the day, but I think it's really better if it's always the same

Re: [Python-ideas] Python Reviewed

2017-01-09 Thread Chris Barker
I just noticed a logical inconsistency here: The Good: > Syntactically significant indenting > The Bad: > Colons at the end of if/while/for blocks. > > No end required for if/while/for blocks. Huh? if you have Syntactically significant indenting, then an "end" indicator is redun

Re: [Python-ideas] Python Reviewed

2017-01-09 Thread Chris Barker
Oh, Here is the history of the colon: http://python-history.blogspot.com/2009/02/early-language-design-and-development.html -CHB On Mon, Jan 9, 2017 at 5:30 PM, Chris Barker wrote: > I just noticed a logical inconsistency here: > > The Good: >> Syntactically significant indenting > > > >

Re: [Python-ideas] Python reviewed

2017-01-09 Thread Alexander Belopolsky
On Mon, Jan 9, 2017 at 8:19 PM, Chris Barker wrote: > > I think maybe by Dijkstra of C++ fame. Dijkstra is famous for many things, but C++ is another Dutchman's fault. Dijkstra's famous works include "GOTO Considered Harmful" [1] and "How do we tell truths that might hurt?" [2]. [1]: http://wik

Re: [Python-ideas] Python reviewed

2017-01-09 Thread Simon Lovell
Also in Python you can use: for x in range (1,j+1): to loop j times. Although it does read as though it is looping j+1 times to those not familiar. One more comment I wanted to make about end blocks, is that a respectable editor will add them for you, together with the indentation of the

Re: [Python-ideas] Python reviewed

2017-01-09 Thread Ned Batchelder
On 1/9/17 8:44 PM, Simon Lovell wrote: > > Also in Python you can use: > > for x in range (1,j+1): > > to loop j times. Although it does read as though it is looping j+1 > times to those not familiar. > > One more comment I wanted to make about end blocks, is that a > respectable editor will add th

Re: [Python-ideas] Python reviewed

2017-01-09 Thread Chris Angelico
On Tue, Jan 10, 2017 at 12:44 PM, Simon Lovell wrote: > Regarding the logical inconsistency of my argument, well I am saying that I > would prefer my redundancy at the end of the loop rather than the beginning. > To say that the status quo is better is to say that you prefer your > redundancy at t

Re: [Python-ideas] Python reviewed

2017-01-09 Thread Erik
On 10/01/17 01:44, Simon Lovell wrote: Regarding the logical inconsistency of my argument, well I am saying that I would prefer my redundancy at the end of the loop rather than the beginning. To say that the status quo is better is to say that you prefer your redundancy at the beginning. It's n

Re: [Python-ideas] Python Reviewed

2017-01-09 Thread Simon Lovell
Hi Kyle, I don't see the harm caused from having a do-while construct. Not the most used construct but it is sometimes useful and not having it means you need to either have a first time through marker or a break at the end of a "while True:" loop. I would say that None should also be non-b

Re: [Python-ideas] Python reviewed

2017-01-09 Thread Simon Lovell
Oh one last thing (I hope), the argument for having the current slice notation by Dijkstra, that it looks messy to have a loop where the contents are never executed or can no longer be executed is ridiculous! That *should* look messy. for range(1,1): means executing once to me. If you had 1 bas

Re: [Python-ideas] Python Reviewed

2017-01-09 Thread Ethan Furman
On 01/09/2017 09:18 PM, Simon Lovell wrote: [snip] This is not the place for this conversation. Please take it to Python List. -- ~Ethan~ ___ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code