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

2017-01-11 Thread INADA Naoki
Here is one example of locale pitfall. --- # from http://unix.stackexchange.com/questions/169739/why-is-coreutils-sort-slower-than-python $ cat letters.py import string import random def main(): for _ in range(1_000_000): c = random.choice(string.ascii_letters) print(c) mai

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

2017-01-11 Thread Stephen J. Turnbull
INADA Naoki writes: > Off course, we can use LC_CTYPE=en_US.UTF-8, instead of LANG or LC_ALL. You can also use LC_COLLATE=C. > (I wonder if we can use LC_CTYPE=UTF-8...) Syntactically incorrect: that means the language UTF-8. "LC_TYPE=.UTF-8" might work, but IIRC the language tag is required,

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

2017-01-11 Thread INADA Naoki
> > > (I wonder if we can use LC_CTYPE=UTF-8...) > > Syntactically incorrect: that means the language UTF-8. > "LC_TYPE=.UTF-8" might work, but IIRC the language tag is required, > the region and encoding are optional. Thus ja_JP, ja.UTF-8 are OK, > but .UTF-8 is not. I'm sorry. I know it, but

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

2017-01-11 Thread Stephan Houben
Hi INADA Naoki, (Sorry, I am unsure if INADA or Naoki is your first name...) While I am very much in favour of everything working "out of the box", an issue is that we don't have control over external code (be it Python extensions or external processes invoked from Python). And that code will on

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

2017-01-11 Thread Petr Viktorin
On 01/11/2017 11:46 AM, Stephan Houben wrote: Hi INADA Naoki, (Sorry, I am unsure if INADA or Naoki is your first name...) While I am very much in favour of everything working "out of the box", an issue is that we don't have control over external code (be it Python extensions or external proces

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

2017-01-11 Thread INADA Naoki
On Wed, Jan 11, 2017 at 7:46 PM, Stephan Houben wrote: > Hi INADA Naoki, > > (Sorry, I am unsure if INADA or Naoki is your first name...) Never mind, I don't care about name ordering. (INADA is family name). > > While I am very much in favour of everything working "out of the box", > an issue is

Re: [Python-ideas] Python reviewed

2017-01-11 Thread Chris Barker - NOAA Federal
for range(1,1): means executing once to me. The indexing/slicing approach was designed for indexing and slicing. Then it made sense to have range() match. But range() is not part of the for construction. It is a convenience function for providing an iterable of integers. And you are welcome to wr

Re: [Python-ideas] How to respond to trolling

2017-01-11 Thread Chris Barker - NOAA Federal
> the effect was dozens of messages with people falling over each other trying to engage the OP, Sure -- but all in one thread > The respondents should have known better. But we like to kibitz-- that's why (many of us) are on this list. Anyway, all (most anyway) of the points brought up are :

Re: [Python-ideas] api suggestions for the cProfile module

2017-01-11 Thread Giampaolo Rodola'
On Wed, Dec 21, 2016 at 1:50 AM, Thane Brimhall wrote: > I use cProfile a lot, and would like to suggest three backwards-compatible > improvements to the API. > > 1: When using cProfile on a specific piece of code I often use the > enable() and disable() methods. It occurred to me that this would

Re: [Python-ideas] How to respond to trolling

2017-01-11 Thread Xavier Combelle
I did not read the thread, but it looks like the insult should be a red flag and a good time to stop immediately and baning the troll Le 10/01/2017 à 22:58, Guido van Rossum a écrit : > Whether the intent was to annoy or just to provoke, the effect was > dozens of messages with people falling ove

Re: [Python-ideas] How to respond to trolling

2017-01-11 Thread Chris Kaynor
On Wed, Jan 11, 2017 at 12:02 PM, Xavier Combelle wrote: > I did not read the thread, but it looks like the insult should be a red flag > and a good time to stop immediately > and baning the troll Personally, when I read the original posting, there is quite a bit of it that comes across as arroga

[Python-ideas] RFC: PEP 540 version 3 (Add a new UTF-8 mode)

2017-01-11 Thread Victor Stinner
Hi, I also implemented my PEP 540, you can now test it! Use the latest patch attached to: http://bugs.python.org/issue29240 I made multiple changes since the first version of my PEP: * The UTF-8 Strict mode now only uses strict for inputs and outputs: it keeps surrogateescape for operating

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

2017-01-11 Thread Victor Stinner
2017-01-06 10:50 GMT+01:00 M.-A. Lemburg : > Victor: I think you are taking the UTF-8 idea a bit too far. > Nick was trying to address the situation where the locale is > set to "C", or rather not set at all (in which case the lib C > defaults to the "C" locale). The latter is a fairly standard > s

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

2017-01-11 Thread INADA Naoki
> My PEP 540 is different than Nick's PEP 538, even for the POSIX > locale. I propose to always use the surrogateescape error handler, > whereas Nick wants to keep the strict error handler for inputs and > outputs. > https://www.python.org/dev/peps/pep-0540/#encoding-and-error-handler > > The surro

Re: [Python-ideas] How to respond to trolling

2017-01-11 Thread Steven D'Aprano
On Wed, Jan 11, 2017 at 02:23:06PM +0900, Stephen J. Turnbull wrote: > Steven D'Aprano writes: > > > Giving a newcomer the Silent Treatment because they've questioned some > > undocumented set of features not open to change is not Open, Considerate > > or Respectful (the CoC). Even if their i

[Python-ideas] Things that won't change (proposed PEP)

2017-01-11 Thread Steven D'Aprano
I have a proposal for an Informational PEP that lists things which will not change in Python. If accepted, it could be linked to from the signup page for the mailing list, and be the one obvious place to point newcomers to if they propose the same old cliches. Thoughts? * * * * *

Re: [Python-ideas] Things that won't change (proposed PEP)

2017-01-11 Thread Chris Angelico
On Thu, Jan 12, 2017 at 1:37 PM, Steven D'Aprano wrote: > I have a proposal for an Informational PEP that lists things which will > not change in Python. If accepted, it could be linked to from the signup > page for the mailing list, and be the one obvious place to point > newcomers to if they pro

Re: [Python-ideas] Things that won't change (proposed PEP)

2017-01-11 Thread Oleg Broytman
On Thu, Jan 12, 2017 at 01:37:41PM +1100, Steven D'Aprano wrote: > Explicit self > - > > Explicit ``self`` is a feature, not a bug. See the > `FAQ > `_ > for more detail.

Re: [Python-ideas] Things that won't change (proposed PEP)

2017-01-11 Thread Chris Barker
I think this is a fine idea, but I also think we could use a more verbose FAC: Frequently Asked Criticisms Some of the same things, but it would focus on the "why" of many of the issues. Many of the things people (newbies, mostly) complain about are simply taste, or legacy that isn't worth chang

Re: [Python-ideas] Things that won't change (proposed PEP)

2017-01-11 Thread Mikhail V
On 12 January 2017 at 03:37, Steven D'Aprano wrote: > I have a proposal for an Informational PEP that lists things which will > not change in Python. If accepted, it could be linked to from the signup > page for the mailing list, and be the one obvious place to point > newcomers to if they propos

[Python-ideas] How to respond to trolling (Guido van Rossum)

2017-01-11 Thread Simon Lovell
I feel I have to respond to this one. More than half of what I suggested could have and should be implemented. In particular the truthiness of non-boolean data and the lack of a reasonable SQL syntax. Several other points have been discussed endlessly on the internet but without a satisfactor

Re: [Python-ideas] Things that won't change (proposed PEP)

2017-01-11 Thread Pavol Lisy
On 1/12/17, Steven D'Aprano wrote: > This shouldn't need saying, but Python 3 will not be abandoned. Except Python 4 would come. ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduc

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

2017-01-11 Thread Chris Barker
It seems to me that having a C locale can mean two things: 1) It really is meant to be ASCII 2) It's mis-configured (or un-configured), meaning the system encoding is unknown. if (2) then utf-8 is a fine default. if (2), then there are two options: 1) Everything on the sytsem really is ASCII -

Re: [Python-ideas] Things that won't change (proposed PEP)

2017-01-11 Thread INADA Naoki
> Built-in functions > > -- > > > > Python is an object-oriented language, but it is not *purely* > > object-oriented. Not everything needs to be `a method of some object > `_, > > and functions have th

Re: [Python-ideas] Things that won't change (proposed PEP)

2017-01-11 Thread Nick Timkovich
Why mention sys.ps1 == '>>> ', is that some inside joke I'm unaware of? That is one of the easier things to modify (with a sitecustomize.py or whatever). On Thu, Jan 12, 2017 at 12:03 AM, INADA Naoki wrote: > > Built-in functions > > > > -- > > > > > > > > Python is an object-ori

Re: [Python-ideas] RFC: PEP 540 version 3 (Add a new UTF-8 mode)

2017-01-11 Thread Nick Coghlan
On 12 January 2017 at 08:15, Victor Stinner wrote: > Hi, > > I also implemented my PEP 540, you can now test it! Use the latest > patch attached to: > >http://bugs.python.org/issue29240 > > > I made multiple changes since the first version of my PEP: > > * The UTF-8 Strict mode now only uses s

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

2017-01-11 Thread Nick Coghlan
On 11 January 2017 at 17:05, Stephen J. Turnbull wrote: > Anyway, I need to look more carefully at the actual PEPs and see if > there's something concrete to worry about. But remember, we have > about 18 months to chew over this if necessary FWIW, I'm hoping to backport whatever improved handlin

Re: [Python-ideas] Things that won't change (proposed PEP)

2017-01-11 Thread Oleg Broytman
On Thu, Jan 12, 2017 at 12:42:46AM -0600, Nick Timkovich wrote: > Why mention sys.ps1 == '>>> ', is that some inside joke I'm unaware of? > That is one of the easier things to modify (with a sitecustomize.py or > whatever). With PYTHONSTARTUP. > On Thu, Jan 12, 2017 at 12:03 AM, INADA Naoki