Re: [Python-Dev] Counting references to Py_None

2016-03-21 Thread Alexander Belopolsky
On Mon, Mar 21, 2016 at 5:56 PM, Tim Peters wrote: > I've seen this trigger, > from C code that had no idea it was playing with None, but just had > general refcounting errors. So this does serve a debugging purpose, > although rarely > You probably have a better refcounting sense that I do, bu

Re: [Python-Dev] Counting references to Py_None

2016-03-21 Thread Tim Peters
Brett Cannon ] >> And if we didn't keep its count accurately it would eventually hit >> zero and constantly have its dealloc function checked for. [Armin Rigo] [> I think the idea is really consistency. If we wanted to avoid all > "Py_INCREF(Py_None);", it would be possible: we could let the refc

Re: [Python-Dev] Counting references to Py_None

2016-03-21 Thread Armin Rigo
Hi, On 20 March 2016 at 18:10, Brett Cannon wrote: > And if we didn't keep its count accurately it would eventually hit > zero and constantly have its dealloc function checked for. I think the idea is really consistency. If we wanted to avoid all "Py_INCREF(Py_None);", it would be possible: we

Re: [Python-Dev] PEP 484 update: allow @overload in regular module files

2016-03-21 Thread Guido van Rossum
This seemed pretty uncontroversial. I've updated the PEP. On Sat, Mar 19, 2016 at 6:52 PM, Guido van Rossum wrote: > Here's another proposal for a change to PEP 484. > > In https://github.com/python/typing/issues/72 there's a long > discussion ending with a reasonable argument to allow @overload

Re: [Python-Dev] PEP 484: updates to Python 2.7 signature syntax

2016-03-21 Thread Guido van Rossum
This seemed pretty uncontroversial -- I've updated the PEP (including a long(ish) example :-). On Sat, Mar 19, 2016 at 6:54 PM, Guido van Rossum wrote: > Heh. I could add an example with a long list of parameters with long > names, but apart from showing by example what the motivation is it > wou

Re: [Python-Dev] PEP 484: a "NewType" constructor

2016-03-21 Thread Guido van Rossum
Sorry, for PEP feedback it's best to use this issue in the typing tracker: https://github.com/python/typing/issues/189 (the issue I linked to was in the mypy tracker). On Mon, Mar 21, 2016 at 9:15 AM, Guido van Rossum wrote: > Here's one more thing we'd like to add to PEP 484. The description is

[Python-Dev] PEP 484: a "NewType" constructor

2016-03-21 Thread Guido van Rossum
Here's one more thing we'd like to add to PEP 484. The description is best gleaned from the issue, in particular https://github.com/python/mypy/issues/1284#issuecomment-199021176 and following (we're going with option (A)). Really brief example: from typing import NewType UserId = NewType('Us