Re: [Python-ideas] Adding an 'errors' argument to print

2017-03-26 Thread Victor Stinner
print(msg) calls sys.stdout.write(msg): write() expects text, not bytes. I dislike the idea of putting encoding options in print. It's too specific. What if tomorrow you replace print() with file.write()? Do you want to add errors there too? No, it's better to write own formatter function as shown

Re: [Python-ideas] Proposal: Query language extension to Python (PythonQL)

2017-03-26 Thread Pavel Velikhov
> On 25 Mar 2017, at 15:51, Gerald Britton wrote: > > On 25 March 2017 at 11:24, Pavel Velikhov > wrote: > > No, the current solution is temporary because we just don’t have the > > manpower to > > implement the full thing: a real system that will rewrite parts of PythonQL >

Re: [Python-ideas] Proposal: Query language extension to Python (PythonQL)

2017-03-26 Thread Pavel Velikhov
Hi David > On 25 Mar 2017, at 20:08, David Mertz wrote: > > I think it's extraordinarily unlikely that a big change in Python syntax to > support query syntax will ever happen. Moreover, I would oppose such a > change myself. > > But just a change also really is not necessary. Pandas alread

Re: [Python-ideas] Proposal: Query language extension to Python (PythonQL)

2017-03-26 Thread Pavel Velikhov
Hi Mark, > On 25 Mar 2017, at 19:54, Mark E. Haase wrote: > > Hi Pavel, > > This is a really impressive body of work. I had looked at this project in the > past but it is great to get back up to speed and see all the progress made. > > I use Python + databases almost every day, and the major

Re: [Python-ideas] Proposal: Query language extension to Python (PythonQL)

2017-03-26 Thread Pavel Velikhov
Hi Michel! > On 25 Mar 2017, at 22:43, Michel Desmoulin wrote: > > Hello, > > I've been following PythonQL with interest. I like the clever hack using > Python encoding. It's definitely not something I would recommend to do > for an inclusion in Python as it hijack the Python encoding method, >

Re: [Python-ideas] Proposal: Query language extension to Python (PythonQL)

2017-03-26 Thread Pavel Velikhov
Terry, > On 26 Mar 2017, at 07:23, Terry Reedy wrote: > > On 3/25/2017 11:40 AM, Kyle Lahnakoski wrote: >> >> Pavel, >> >> I like PythonQL. I perform a lot of data transformation, and often find >> Python's list comprehensions too limiting; leaving me wishing for >> LINQ-like language features

Re: [Python-ideas] Proposal: Query language extension to Python (PythonQL)

2017-03-26 Thread Pavel Velikhov
Hi Nick, Thanks for such a detailed response! > On 25 Mar 2017, at 19:40, Nick Coghlan wrote: > > First off, I think PythonQL (and PonyORM before it) is a very > interesting piece of technology. However, I think some of the answers > so far suggest we may need to discuss a couple of meta-iss

Re: [Python-ideas] Adding an 'errors' argument to print

2017-03-26 Thread Nick Coghlan
On 26 March 2017 at 18:31, Victor Stinner wrote: > print(msg) calls sys.stdout.write(msg): write() expects text, not bytes. I > dislike the idea of putting encoding options in print. It's too specific. > What if tomorrow you replace print() with file.write()? Do you want to add > errors there too?

Re: [Python-ideas] Adding an 'errors' argument to print

2017-03-26 Thread Ryan Gonzalez
FWIW, using the ascii function does have the problem that Unicose characters will be escaped, even if the terminal could have handled them perfectly fine. -- Ryan (ライアン) Yoko Shimomura > ryo (supercell/EGOIST) > Hiroyuki Sawano >> everyone else http://refi64.com On Mar 26, 2017 9:07 AM, "Nick Cog

Re: [Python-ideas] Proposal: Query language extension to Python (PythonQL)

2017-03-26 Thread Nick Coghlan
On 26 March 2017 at 21:40, Pavel Velikhov wrote: > On 25 Mar 2017, at 19:40, Nick Coghlan wrote: >> Right, the target audience here *isn't* folks who already know how to >> construct their own relational queries in SQL, and it definitely isn't >> folks that know how to tweak their queries to get

Re: [Python-ideas] Proposal: Query language extension to Python (PythonQL)

2017-03-26 Thread Pavel Velikhov
Hi Nick! > On 26 Mar 2017, at 18:02, Nick Coghlan wrote: > > On 26 March 2017 at 21:40, Pavel Velikhov wrote: >> On 25 Mar 2017, at 19:40, Nick Coghlan wrote: >>> Right, the target audience here *isn't* folks who already know how to >>> construct their own relational queries in SQL, and it def

Re: [Python-ideas] Adding an 'errors' argument to print

2017-03-26 Thread Michel Desmoulin
Le 26/03/2017 à 10:31, Victor Stinner a écrit : > print(msg) calls sys.stdout.write(msg): write() expects text, not bytes. What you are saying right now is that the API is not granular enough to just add a parameter. Not that it can't be done. It just mean we need to expose stdout.write() encodi

Re: [Python-ideas] Adding an 'errors' argument to print

2017-03-26 Thread Chris Angelico
On Mon, Mar 27, 2017 at 5:22 AM, Michel Desmoulin wrote: > > > Le 26/03/2017 à 10:31, Victor Stinner a écrit : >> print(msg) calls sys.stdout.write(msg): write() expects text, not bytes. > > What you are saying right now is that the API is not granular enough to > just add a parameter. Not that it

Re: [Python-ideas] Adding an 'errors' argument to print

2017-03-26 Thread Michel Desmoulin
Yes Python is turing complete, there is always a solution to everything. You can also do decorators with func = wrapper(func) instead of @wrapper, no need for a new syntax. Le 26/03/2017 à 20:42, Chris Angelico a écrit : > On Mon, Mar 27, 2017 at 5:22 AM, Michel Desmoulin > wrote: >> >> >> Le 26/

[Python-ideas] IDEA

2017-03-26 Thread Faaiz Asim via Python-ideas
Hi, I am currently enrolled in computer science program and am currently in 6th semester. I am comfortable using c++,java,python in general. I know this is a little late for proposing an idea but i was busy in exams. Besides i wanted to get into something where i was determined to contribute to the

Re: [Python-ideas] IDEA

2017-03-26 Thread Ryan Gonzalez
There are quite a few Python IDEs, like PyCharm, Ninja, Spyder, PyDev, and more. In addition, I would say that almost every currently existent text editor has at least *some* Python support (I personally use Howl, though I'll admit I'm rather biased, being part of the development team and all... ;)

Re: [Python-ideas] IDEA

2017-03-26 Thread Terry Reedy
On 3/26/2017 3:08 PM, Faaiz Asim via Python-ideas wrote: To add to what I said on core_mentorship list, you should read https://docs.python.org/devguide/ keeping in mind that some details are in flux due to the transition from hg to git and github. I am aware of the default IDE (IDLE) which s

Re: [Python-ideas] Proposal: Query language extension to Python (PythonQL)

2017-03-26 Thread Terry Reedy
On 3/26/2017 7:14 AM, Pavel Velikhov wrote: On 26 Mar 2017, at 07:23, Terry Reedy Someone mentioned the problem of adding multiple new keywords. Even 1 requires a proposal to meet a high bar; I think we average less than 1 new keyword per release in the last 20 years. Searching '\bgroup\b' ju

Re: [Python-ideas] Proposal: Query language extension to Python (PythonQL)

2017-03-26 Thread Chris Angelico
On Mon, Mar 27, 2017 at 12:26 PM, Terry Reedy wrote: > It might be possible (or not!) to make the clause-heading words like 'where' > or 'groupby' (this would have to be one word) recognized as special only in > the context of starting a new comprehension clause. The precedents for > 'keyword in c

Re: [Python-ideas] IDEA

2017-03-26 Thread Wes Turner
On Sun, Mar 26, 2017 at 2:08 PM, Faaiz Asim via Python-ideas < python-ideas@python.org> wrote: > Hi, > I am currently enrolled in computer science program and am currently in > 6th semester. I am comfortable using c++,java,python in general. I know > this is a little late for proposing an idea but

[Python-ideas] (no subject)

2017-03-26 Thread Gerald Britton
>* On 25 Mar 2017, at 15:51, Gerald Britton > wrote: > *> >* On 25 March 2017 at 11:24, Pavel Velikhov >> wrote: > *>* > No, the current solution is temporary because we just don’t have

Re: [Python-ideas] Adding an 'errors' argument to print

2017-03-26 Thread Steve Dower
On 26Mar2017 0707, Nick Coghlan wrote: Perhaps it would be worth noting in the table of error handlers at https://docs.python.org/3/library/codecs.html#error-handlers that backslashreplace is used by the `ascii()` builtin and the associated format specifiers backslashreplace is also the default

Re: [Python-ideas] Proposal: Query language extension to Python (PythonQL)

2017-03-26 Thread Wes Turner
On Sun, Mar 26, 2017 at 10:02 AM, Nick Coghlan wrote: > On 26 March 2017 at 21:40, Pavel Velikhov > wrote: > > On 25 Mar 2017, at 19:40, Nick Coghlan wrote: > >> Right, the target audience here *isn't* folks who already know how to > >> construct their own relational queries in SQL, and it defi

Re: [Python-ideas] Proposal: Query language extension to Python (PythonQL)

2017-03-26 Thread Wes Turner
On Sun, Mar 26, 2017 at 10:42 PM, Wes Turner wrote: > > > On Sun, Mar 26, 2017 at 10:02 AM, Nick Coghlan wrote: > >> On 26 March 2017 at 21:40, Pavel Velikhov >> wrote: >> > On 25 Mar 2017, at 19:40, Nick Coghlan wrote: >> >> Right, the target audience here *isn't* folks who already know how t

Re: [Python-ideas] Adding an 'errors' argument to print

2017-03-26 Thread Nick Coghlan
On 27 March 2017 at 13:10, Steve Dower wrote: > On 26Mar2017 0707, Nick Coghlan wrote: >> >> Perhaps it would be worth noting in the table of error handlers at >> https://docs.python.org/3/library/codecs.html#error-handlers that >> backslashreplace is used by the `ascii()` builtin and the associat