Re: [Python-Dev] Can we use "designated initializer" widely in coremodules?

2017-01-18 Thread Brett Cannon
On Tue, 17 Jan 2017 at 18:36 Nathaniel Smith wrote: > On Tue, Jan 17, 2017 at 4:48 PM, INADA Naoki > wrote: > > On Wed, Jan 18, 2017 at 8:48 AM, Larry Hastings > wrote: > >> > >> On 01/17/2017 12:02 PM, Steve Dower wrote: > >> > >> Avoiding header files would be my only request. As Brett says,

Re: [Python-Dev] collections.abc for data and non-data descriptors

2017-01-18 Thread Guido van Rossum
It's probably big enough to make it a new PEP. On Wed, Jan 18, 2017 at 7:45 AM, Ivan Levkivskyi wrote: > On 18 January 2017 at 16:35, Guido van Rossum wrote: > >> I'd rather wait until support for protocols has been added to PEP 484. >> > > Sorry for offtopic but do you think this should be an

Re: [Python-Dev] collections.abc for data and non-data descriptors

2017-01-18 Thread Ivan Levkivskyi
On 18 January 2017 at 16:35, Guido van Rossum wrote: > I'd rather wait until support for protocols has been added to PEP 484. > Sorry for offtopic but do you think this should be an addition to PEP 484 or a separate PEP? I am interested in writing the specification (based on what Jukka proposed

Re: [Python-Dev] collections.abc for data and non-data descriptors

2017-01-18 Thread Guido van Rossum
I'd rather wait until support for protocols has been added to PEP 484. On Wed, Jan 18, 2017 at 2:25 AM, Ivan Levkivskyi wrote: > A random thought: typing has ABCs for protocols, even more than > collections.abc has (e.g. typing.SupportsInt). Some support for descriptors > has been added to mypy

Re: [Python-Dev] Can we use "designated initializer" widely in core modules?

2017-01-18 Thread Victor Stinner
2017-01-18 12:33 GMT+01:00 Antoine Pitrou : > I don't think I thought about that idea at the time. tp_finalize > doesn't benefit many extension types, so it's not a huge burden to add > a FLAGS value for the few cases where you want to use it. It isn't obvious to me that I have to define explicit

Re: [Python-Dev] Can we use "designated initializer" widely in core modules?

2017-01-18 Thread Ronald Oussoren
> On 18 Jan 2017, at 02:16, Victor Stinner wrote: > > 2017-01-18 1:59 GMT+01:00 INADA Naoki : >> I think mixing two forms is OK only if new form is used only at bottom. >> (like keyword arguments are allowed after all positional arguments in >> Python function calling) >> >> Complete rewriting

Re: [Python-Dev] Can we use "designated initializer" widely in core modules?

2017-01-18 Thread Antoine Pitrou
On Wed, 18 Jan 2017 08:44:29 +0100 Victor Stinner wrote: > > My patch adds Py_TPFLAGS_HAVE_FINALIZE and Py_TPFLAGS_HAVE_FASTCALL to > Py_TPFLAGS_DEFAULT. So all modules compiled with Python 3.7 will > announce that they have tp_finalize and tp_fastcall fields, even if > they are NULL. I don't kno

Re: [Python-Dev] collections.abc for data and non-data descriptors

2017-01-18 Thread Ivan Levkivskyi
A random thought: typing has ABCs for protocols, even more than collections.abc has (e.g. typing.SupportsInt). Some support for descriptors has been added to mypy recently. Maybe it makes sense to add support for descriptor protocol in typing? -- Ivan On 18 January 2017 at 05:44, Raymond Hetting