[Python-ideas] Re: Universal parsing library in the stdlib to alleviate security issues

2019-07-16 Thread Anders Hovmöller
> On 17 Jul 2019, at 06:30, Nam Nguyen wrote: > > On Mon, Jul 15, 2019 at 8:47 PM Andrew Barnert > wrote: > On Jul 15, 2019, at 18:44, Nam Nguyen > wrote: > >> I have implemented a tiny (~200 SLOCs) package at >> https://gitlab.com/nam-ng

[Python-ideas] Re: Universal parsing library in the stdlib to alleviate security issues

2019-07-16 Thread Andrew Barnert via Python-ideas
On Jul 16, 2019, at 21:30, Nam Nguyen wrote: >> Can you add failure handling without breaking the “~200LOC and easy to read” >> feature of the library, and without breaking the “easy to read once you grok >> parser combinators” feature of the parsers built with it? > This is a good request. I w

[Python-ideas] Re: Stdlib Module

2019-07-16 Thread Andrew Barnert via Python-ideas
On Jul 16, 2019, at 10:20, Abdur-Rahmaan Janhangeer wrote: > > I must make a C or pure Python demo? You can definitely implement this in pure Python. It doesn’t need C for performance reasons, it’s not going to be bootstrapped into the start sequence, it doesn’t need access to C-only APIs, et

[Python-ideas] Re: Universal parsing library in the stdlib to alleviate security issues

2019-07-16 Thread Nam Nguyen
On Mon, Jul 15, 2019 at 8:47 PM Andrew Barnert wrote: > On Jul 15, 2019, at 18:44, Nam Nguyen wrote: > > I have implemented a tiny (~200 SLOCs) package at > https://gitlab.com/nam-nguyen/parser_compynator that demonstrates > something like this is possible. There are several examples for you to

[Python-ideas] Re: Universal parsing library in the stdlib to alleviate security issues

2019-07-16 Thread Nam Nguyen
On Tue, Jul 16, 2019 at 1:18 PM Barry wrote: > > > > On 16 Jul 2019, at 04:47, Andrew Barnert via Python-ideas < > python-ideas@python.org> wrote: > > > > How often do you need to parse a million URLs in your inner loop? > > As it happens i work on code that would be impacted by such a slow down.

[Python-ideas] Re: Stdlib Module

2019-07-16 Thread Abdur-Rahmaan Janhangeer
Read the 6th mail sent chronologically. Will do. Abdur-Rahmaan Janhangeer Mauritius On Wed, 17 Jul 2019, 02:26 Steven D'Aprano, wrote: > On Mon, Jul 15, 2019 at 10:47:06PM +0400, Abdur-Rahmaan Janhangeer wrote: > > Greetings, > > > > Just like builtins module, would it be a good idea to have a

[Python-ideas] Re: Adding where keyword inside list coprehensions

2019-07-16 Thread Steven D'Aprano
On Mon, Jul 15, 2019 at 08:18:30AM -0700, Fabrizio Messina wrote: > [ > price * (1 + vat) > for > item in basket > if > price is not None > where > price := item.get('price') > vat := get_vat(item, user) > ] Since vat is only used once, we don't

[Python-ideas] Re: Stdlib Module

2019-07-16 Thread Steven D'Aprano
On Mon, Jul 15, 2019 at 10:47:06PM +0400, Abdur-Rahmaan Janhangeer wrote: > Greetings, > > Just like builtins module, would it be a good idea to have a stdlib module > so that we can know all modules in the std lib (just like builtins let us > know builtins)? The builtins module doesn't exist onl

[Python-ideas] Re: Stdlib Module

2019-07-16 Thread Steven D'Aprano
On Tue, Jul 16, 2019 at 09:50:19AM -0700, Christopher Barker wrote: > On Tue, Jul 16, 2019 at 4:44 AM Steven D'Aprano wrote: > > > > This would be an opportunity to clearly define the “standard library” as > > > something other than “all the stuff that ships with cPython” > > > > CPython is the r

[Python-ideas] Re: Universal parsing library in the stdlib to alleviate security issues

2019-07-16 Thread Barry
> On 16 Jul 2019, at 04:47, Andrew Barnert via Python-ideas > wrote: > > How often do you need to parse a million URLs in your inner loop? As it happens i work on code that would be impacted by such a slow down. It runs in production 24x7 and parses URLs on its critical path. Barry _

[Python-ideas] Re: Stdlib Module

2019-07-16 Thread Abdur-Rahmaan Janhangeer
I must make a C or pure Python demo? Abdur-Rahmaan Janhangeer Mauritius ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/

[Python-ideas] Re: Stdlib Module

2019-07-16 Thread Christopher Barker
On Tue, Jul 16, 2019 at 4:44 AM Steven D'Aprano wrote: > > This would be an opportunity to clearly define the “standard library” as > > something other than “all the stuff that ships with cPython” > > CPython is the reference implementation. It is expected that anything > shipped by CPython ought

[Python-ideas] Re: Stdlib Module

2019-07-16 Thread Steven D'Aprano
On Mon, Jul 15, 2019 at 07:29:59PM -0700, Christopher Barker wrote: > I think this may be a worthwhile idea — after all, “namespaces are one > honking great idea” > > This would be an opportunity to clearly define the “standard library” as > something other than “all the stuff that ships with cPyt

[Python-ideas] Re: Stdlib Module

2019-07-16 Thread Steven D'Aprano
On Mon, Jul 15, 2019 at 01:36:06PM -0700, Andrew Barnert via Python-ideas wrote: > What exactly goes in stdlib? The standard library modules documented at python.org. Note that being part of the std lib doesn't necessarily mean that it will be available, even on CPython. The contents of stdlib