Re: [Python-ideas] PEP 560 (second post)

2017-09-28 Thread Nick Coghlan
On 29 September 2017 at 08:04, Ivan Levkivskyi wrote: > On 28 September 2017 at 08:27, Nick Coghlan wrote: >> >> On 27 September 2017 at 19:28, Ivan Levkivskyi >> wrote: >> > If an object that is not a class object appears in the bases of a class >> > definition, the ``__subclass_base__`` is sea

Re: [Python-ideas] allow overriding files used for the input builtin

2017-09-28 Thread Amit Green
I'm fine with the idea in general of extra keyword parameters to the input function. A few points: Your example code, needs try/catch to match what the input with parameters does -- and yes, its way nicer to be able to use it the example you have shown than play games with try/catch (Personally I

[Python-ideas] allow overriding files used for the input builtin

2017-09-28 Thread Wren Turkal
Hi there, I have posted an idea for improvement with a PR of an implementation to https://bugs.python.org/issue31603. The basic idea is to add fin, fout, and ferr file object parameters and default to using what is used today when the args are not specified. I believe this would be useful to

Re: [Python-ideas] Changes to the existing optimization levels

2017-09-28 Thread Diana Clarke
Perhaps I should be a bit clearer. When I said the "level 3" approach "appears to be inline with the direction Victor Stinner is going in for PEP 511", it was mostly at a superficial level. Meaning: - PEP 511 still appears to use integer (unnamed) optimization levels for alternate transformers (f

Re: [Python-ideas] Changes to the existing optimization levels

2017-09-28 Thread Diana Clarke
Yup. I referenced your pep a few times in a previous off-list email, but I omitted that paragraph from this pass because I was using it to bolster the previous "level 3" idea (which didn't fly). """ This simple approach to new optimization levels also appears to be inline with the direction Victor

Re: [Python-ideas] Changes to the existing optimization levels

2017-09-28 Thread Victor Stinner
> 2) Added a new command line option N that allows you to specify > any number of individual optimization flags. > > For example: > > python -N nodebug -N noassert -N nodocstring You may want to look at my PEP 511 which proposes to add a new "-o" option to specify a list of optimiz

Re: [Python-ideas] PEP 560 (second post)

2017-09-28 Thread Ivan Levkivskyi
On 28 September 2017 at 08:27, Nick Coghlan wrote: > On 27 September 2017 at 19:28, Ivan Levkivskyi > wrote: > > If an object that is not a class object appears in the bases of a class > > definition, the ``__subclass_base__`` is searched on it. If found, > > it is called with the original tuple

Re: [Python-ideas] Changes to the existing optimization levels

2017-09-28 Thread Antoine Pitrou
On Thu, 28 Sep 2017 12:48:15 -0600 Diana Clarke wrote: > > 2) Added a new command line option N that allows you to specify > any number of individual optimization flags. > > For example: > > python -N nodebug -N noassert -N nodocstring We could instead reuse the existing -X opt

[Python-ideas] Changes to the existing optimization levels

2017-09-28 Thread Diana Clarke
Hi folks: I was recently looking for an entry-level cpython task to work on in my spare time and plucked this off of someone's TODO list. "Make optimizations more fine-grained than just -O and -OO" There are currently three supported optimization levels (0, 1, and 2). Briefly summarized, the