Re: [Python-Dev] PEP 509: Add a private version to dict

2016-01-20 Thread Yury Selivanov
On 2016-01-20 8:54 PM, Andrew Barnert via Python-Dev wrote: >I think Glenn was assuming we had a single, global version # that all dicts shared without having a per-dict version ID. The key thing here is that we have a global counter that tracks the number of mutations for all dictionaries

Re: [Python-Dev] PEP 509: Add a private version to dict

2016-01-20 Thread Andrew Barnert via Python-Dev
On Wednesday, January 20, 2016 4:10 PM, Brett Cannon wrote: >I think Glenn was assuming we had a single, global version # that all dicts >shared without having a per-dict version ID. The key thing here is that we >have a global counter that tracks the number of mutations for

Re: [Python-Dev] PEP 509: Add a private version to dict

2016-01-20 Thread Yury Selivanov
On 2016-01-20 5:01 PM, Greg Ewing wrote: Yury Selivanov wrote: What I propose is to add a pointer "ma_extra" (same 64bits), which will be set to NULL for most dict instances (instead of ma_version). "ma_extra" can then point to a struct that has a globally unique dict ID (uint64), and a

Re: [Python-Dev] PEP 509: Add a private version to dict

2016-01-20 Thread Brett Cannon
On Wed, 20 Jan 2016, 17:54 Andrew Barnert wrote: > On Wednesday, January 20, 2016 4:10 PM, Brett Cannon > wrote: > > > >I think Glenn was assuming we had a single, global version # that all > dicts shared without having a per-dict version ID. The key thing

Re: [Python-Dev] Devguide: Add a table summarizing status of Python branches

2016-01-20 Thread Victor Stinner
2016-01-20 22:22 GMT+01:00 Victor Stinner : > I pushed my table, it will be online in a few hours (I don't know when > the devguide is recompiled?): > http://docs.python.org/devguide/triaging.html#generating-special-links-in-a-comment Hum ok, it takes more than a few

Re: [Python-Dev] PEP 509: Add a private version to dict

2016-01-20 Thread Greg Ewing
Andrew Barnert via Python-Dev wrote: imagine someone manages to remove the GIL from CPython by using STM: now most transactions are bumping that global counter, meaning most transactions fail and have to be retried, If this becomes a problem, the tag could be split into two parts of m and n

Re: [Python-Dev] Update PEP 7 to require curly braces in C

2016-01-20 Thread Nick Coghlan
On 21 January 2016 at 10:16, Brett Cannon wrote: > I just checked with Van and we should have CLAs for even PEP contributors, > so it will have to go through the same steps as the other ancillary > repositories. We should probably mention that in PEP 1 - I wasn't aware of that

Re: [Python-Dev] Update PEP 7 to require curly braces in C

2016-01-20 Thread Brett Cannon
On Tue, 19 Jan 2016 at 19:33 Martin Panter wrote: > On 19 January 2016 at 20:12, Brett Cannon wrote: > > Here is a proposed update: > > > > diff -r 633f51d10a67 pep-0007.txt > > --- a/pep-0007.txt Mon Jan 18 10:52:57 2016 -0800 > > +++ b/pep-0007.txt Tue

Re: [Python-Dev] PEP 509: Add a private version to dict

2016-01-20 Thread Maciej Fijalkowski
The easiest version is to have global numbering (as opposed to local). Anyway, I would strongly suggest getting some benchmarks done and showing performance benefits first, because you don't want PEPs to be final when you don't exactly know the details. On Wed, Jan 20, 2016 at 7:02 PM, Yury

Re: [Python-Dev] PEP 509: Add a private version to dict

2016-01-20 Thread Maciej Fijalkowski
On Wed, Jan 20, 2016 at 7:22 PM, Brett Cannon wrote: > > > On Wed, 20 Jan 2016 at 10:11 Yury Selivanov wrote: >> >> On 2016-01-18 5:43 PM, Victor Stinner wrote: >> > Is someone opposed to this PEP 509? >> > >> > The main complain was the change on the

Re: [Python-Dev] PEP 509: Add a private version to dict

2016-01-20 Thread Yury Selivanov
Brett, On 2016-01-20 1:22 PM, Brett Cannon wrote: On Wed, 20 Jan 2016 at 10:11 Yury Selivanov > wrote: On 2016-01-18 5:43 PM, Victor Stinner wrote: > Is someone opposed to this PEP 509? > > The main complain was the

[Python-Dev] Devguide: Add a table summarizing status of Python branches

2016-01-20 Thread Victor Stinner
Hi, I proposed a patch for the devguide to give the current status of all Python branches: active, bugfix, security only, end-of-line, with their end-of-life when applicable (past date or scheduled date) http://bugs.python.org/issue26165 What do you think? Does it look correct? We will have to

Re: [Python-Dev] PEP 509: Add a private version to dict

2016-01-20 Thread Yury Selivanov
On 2016-01-18 5:43 PM, Victor Stinner wrote: Is someone opposed to this PEP 509? The main complain was the change on the public Python API, but the PEP doesn't change the Python API anymore. I'm not aware of any remaining issue on this PEP. Victor, I've been experimenting with the PEP to

Re: [Python-Dev] PEP 509: Add a private version to dict

2016-01-20 Thread Brett Cannon
On Wed, 20 Jan 2016 at 10:11 Yury Selivanov wrote: > On 2016-01-18 5:43 PM, Victor Stinner wrote: > > Is someone opposed to this PEP 509? > > > > The main complain was the change on the public Python API, but the PEP > > doesn't change the Python API anymore. > > > > I'm

Re: [Python-Dev] Code formatter bot

2016-01-20 Thread Ben Finney
Andrew Barnert via Python-Dev writes: > […] it can be helpful to have both suggested editor plugins that do > the auto formatting on the dev's computer, and VCS-triggered checkers > that ensure the formatting was correct. Right, I was not intending the different stages to

Re: [Python-Dev] PEP 509: Add a private version to dict

2016-01-20 Thread Maciej Fijalkowski
On Wed, Jan 20, 2016 at 8:00 PM, Yury Selivanov wrote: > > > On 2016-01-20 1:36 PM, Maciej Fijalkowski wrote: >> >> On Wed, Jan 20, 2016 at 7:22 PM, Brett Cannon wrote: >>> >>> >>> On Wed, 20 Jan 2016 at 10:11 Yury Selivanov

Re: [Python-Dev] PEP 509: Add a private version to dict

2016-01-20 Thread Glenn Linderman
On 1/20/2016 10:36 AM, Maciej Fijalkowski wrote: Why can't you simply use the id of the dict object as the globally unique >dict ID? It's already globally unique amongst all Python objects which makes >it inherently unique amongst dicts. > >___

Re: [Python-Dev] PEP 509: Add a private version to dict

2016-01-20 Thread Yury Selivanov
On 2016-01-20 1:36 PM, Maciej Fijalkowski wrote: On Wed, Jan 20, 2016 at 7:22 PM, Brett Cannon wrote: On Wed, 20 Jan 2016 at 10:11 Yury Selivanov wrote: [..] "ma_extra" would also make it easier for us to extend dicts in the future. Why can't

Re: [Python-Dev] PEP 509: Add a private version to dict

2016-01-20 Thread Yury Selivanov
On 2016-01-20 2:09 PM, Maciej Fijalkowski wrote: > You don't free a version tag that's stored in the guard. You store the object and not id Ah, got it. Although for my current cache design it would be more memory efficient to use the dict itself to store its own unique id and tag, hence my

Re: [Python-Dev] PEP 509: Add a private version to dict

2016-01-20 Thread Maciej Fijalkowski
there is also the problem that you don't want it on all dicts. So having two extra words is more to pay than having extra objects (also, comparison is cheaper for guards) On Wed, Jan 20, 2016 at 8:23 PM, Yury Selivanov wrote: > > > On 2016-01-20 2:09 PM, Maciej

Re: [Python-Dev] PEP 509: Add a private version to dict

2016-01-20 Thread Yury Selivanov
On 2016-01-20 2:02 PM, Maciej Fijalkowski wrote: On Wed, Jan 20, 2016 at 8:00 PM, Yury Selivanov wrote: [..] Brett, you need two things - the ID of the dict and the version tag. What we do in pypy is we have a small object (called, surprisingly, VersionTag()) and we

Re: [Python-Dev] PEP 509: Add a private version to dict

2016-01-20 Thread Maciej Fijalkowski
On Wed, Jan 20, 2016 at 8:08 PM, Yury Selivanov wrote: > > On 2016-01-20 2:02 PM, Maciej Fijalkowski wrote: >> >> On Wed, Jan 20, 2016 at 8:00 PM, Yury Selivanov >> wrote: >> > [..] Brett, you need two things - the ID of the dict and

Re: [Python-Dev] Update PEP 7 to require curly braces in C

2016-01-20 Thread Brett Cannon
On Wed, 20 Jan 2016 at 10:45 Terry Reedy wrote: > On 1/20/2016 12:45 PM, Brett Cannon wrote: > > > > > > On Tue, 19 Jan 2016 at 19:33 Martin Panter > > wrote: > > > > On 19 January 2016 at 20:12, Brett Cannon

Re: [Python-Dev] PEP 509: Add a private version to dict

2016-01-20 Thread Mark Shannon
On 11/01/16 16:49, Victor Stinner wrote: Hi, After a first round on python-ideas, here is the second version of my PEP. The main changes since the first version are that the dictionary version is no more exposed at the Python level and the field type now also has a size of 64-bit on 32-bit

Re: [Python-Dev] PEP 509: Add a private version to dict

2016-01-20 Thread Glenn Linderman
On 1/20/2016 12:50 PM, Brett Cannon wrote: A global (shared between all dicts) unit64 ma_version is actually quite reliable -- if a program does 1,000,000 dict modifications per second, it would take it 600,000 years till wrap-around. But would invalidate everything, instead

Re: [Python-Dev] Devguide: Add a table summarizing status of Python branches

2016-01-20 Thread Brett Cannon
On Wed, 20 Jan 2016 at 10:40 Terry Reedy wrote: > On 1/20/2016 12:40 PM, Victor Stinner wrote: > > Hi, > > > > I proposed a patch for the devguide to give the current status of all > > Python branches: active, bugfix, security only, end-of-line, with > > their end-of-life when

Re: [Python-Dev] PEP 509: Add a private version to dict

2016-01-20 Thread Brett Cannon
On Wed, 20 Jan 2016 at 10:46 Yury Selivanov wrote: > Brett, > > On 2016-01-20 1:22 PM, Brett Cannon wrote: > > > > > > On Wed, 20 Jan 2016 at 10:11 Yury Selivanov > > wrote: > > > > On 2016-01-18 5:43 PM,

Re: [Python-Dev] PEP 509: Add a private version to dict

2016-01-20 Thread Yury Selivanov
On 2016-01-20 2:45 PM, Glenn Linderman wrote: For the reuse case, can't you simply keep the ma_version "live" in dict items on the free list, rather than starting over at (presumably) 0 ? Then if the dict is reused, it bumps the ma_version, and the fallback code goes on with (presumably)

Re: [Python-Dev] PEP 509: Add a private version to dict

2016-01-20 Thread Brett Cannon
On Wed, 20 Jan 2016 at 12:27 Yury Selivanov wrote: > > > On 2016-01-20 2:45 PM, Glenn Linderman wrote: > > For the reuse case, can't you simply keep the ma_version "live" in > > dict items on the free list, rather than starting over at (presumably) > > 0 ? Then if the

Re: [Python-Dev] Devguide: Add a table summarizing status of Python branches

2016-01-20 Thread Victor Stinner
I pushed my table, it will be online in a few hours (I don't know when the devguide is recompiled?): http://docs.python.org/devguide/triaging.html#generating-special-links-in-a-comment By the way, it would be super cool to rebuild the PEPs with a post-commit hook server-side, rather than having

Re: [Python-Dev] PEP 509: Add a private version to dict

2016-01-20 Thread Greg Ewing
Yury Selivanov wrote: What I propose is to add a pointer "ma_extra" (same 64bits), which will be set to NULL for most dict instances (instead of ma_version). "ma_extra" can then point to a struct that has a globally unique dict ID (uint64), and a version tag (unit64). Why not just use a

Re: [Python-Dev] Code formatter bot

2016-01-20 Thread francismb
Thanks again to all persons that commented so far. > what's your opinion about a code-formatter bot for cpython. > Pros, Cons, where could be applicable (new commits, new workflow, it > doesn't make sense), ... > > > - At least it should follow PEP 7 ;-) > - ... There seems to be too much

Re: [Python-Dev] Update PEP 7 to require curly braces in C

2016-01-20 Thread Guido van Rossum
The wording is totally fine! You might still want to revert it and re-commit it so it doesn't look like a mistake when reviewing the log. BTW When can we start using git for the peps repo? On Wed, Jan 20, 2016 at 12:18 PM, Brett Cannon wrote: > > > On Wed, 20 Jan 2016 at

Re: [Python-Dev] Update PEP 7 to require curly braces in C

2016-01-20 Thread Brett Cannon
On Wed, 20 Jan 2016 at 14:31 Guido van Rossum wrote: > The wording is totally fine! You might still want to revert it and > re-commit it so it doesn't look like a mistake when reviewing the log. > Sure thing! > > BTW When can we start using git for the peps repo? > Depends

Re: [Python-Dev] Devguide: Add a table summarizing status of Python branches

2016-01-20 Thread Victor Stinner
2016-01-20 23:01 GMT+01:00 Brett Cannon : > This is a proposed optional, future feature leading from moving to GitHub: > https://www.python.org/dev/peps/pep-0512/#web-hooks-for-re-generating-web-content I'm using the free service ReadTheDocs.org and it's really impressive how

Re: [Python-Dev] Devguide: Add a table summarizing status of Python branches

2016-01-20 Thread Brett Cannon
On Wed, 20 Jan 2016 at 09:41 Victor Stinner wrote: > Hi, > > I proposed a patch for the devguide to give the current status of all > Python branches: active, bugfix, security only, end-of-line, with > their end-of-life when applicable (past date or scheduled date) >

Re: [Python-Dev] Code formatter bot

2016-01-20 Thread Andrew Barnert via Python-Dev
On Jan 20, 2016, at 00:35, Ben Finney wrote: > > francismb writes: > >> what's your opinion about a code-formatter bot for cpython. > > What is the proposal? The opinions will surely depend on: ... plus: * How does the formatter bot deal with

Re: [Python-Dev] PEP 509: Add a private version to dict

2016-01-20 Thread Yury Selivanov
On 2016-01-20 1:15 PM, Maciej Fijalkowski wrote: [..] Anyway, I would strongly suggest getting some benchmarks done and showing performance benefits first, because you don't want PEPs to be final when you don't exactly know the details. I agree 100%. Yury

Re: [Python-Dev] Devguide: Add a table summarizing status of Python branches

2016-01-20 Thread Terry Reedy
On 1/20/2016 12:40 PM, Victor Stinner wrote: Hi, I proposed a patch for the devguide to give the current status of all Python branches: active, bugfix, security only, end-of-line, with their end-of-life when applicable (past date or scheduled date) http://bugs.python.org/issue26165 What do you

Re: [Python-Dev] Update PEP 7 to require curly braces in C

2016-01-20 Thread Terry Reedy
On 1/20/2016 12:45 PM, Brett Cannon wrote: On Tue, 19 Jan 2016 at 19:33 Martin Panter > wrote: On 19 January 2016 at 20:12, Brett Cannon > wrote: > Here is a proposed update: >

Re: [Python-Dev] Devguide: Add a table summarizing status of Python branches

2016-01-20 Thread Brett Cannon
On Wed, 20 Jan 2016 at 13:22 Victor Stinner wrote: > I pushed my table, it will be online in a few hours (I don't know when > the devguide is recompiled?): > > http://docs.python.org/devguide/triaging.html#generating-special-links-in-a-comment > > By the way, it would

Re: [Python-Dev] PEP 509: Add a private version to dict

2016-01-20 Thread Victor Stinner
Hi, 2016-01-20 22:18 GMT+01:00 Glenn Linderman : > On 1/20/2016 12:50 PM, Brett Cannon wrote: >> >> A global (shared between all dicts) unit64 ma_version is actually quite >> reliable -- if a program does 1,000,000 dict modifications per second, >> it would take it 600,000

Re: [Python-Dev] PEP 509: Add a private version to dict

2016-01-20 Thread Brett Cannon
On Wed, 20 Jan 2016 at 15:46 Victor Stinner wrote: > Hi, > > 2016-01-20 22:18 GMT+01:00 Glenn Linderman : > > On 1/20/2016 12:50 PM, Brett Cannon wrote: > >> > >> A global (shared between all dicts) unit64 ma_version is actually quite > >>

Re: [Python-Dev] PEP 509: Add a private version to dict

2016-01-20 Thread Glenn Linderman
On 1/20/2016 4:08 PM, Brett Cannon wrote: On Wed, 20 Jan 2016 at 15:46 Victor Stinner > wrote: Hi, 2016-01-20 22:18 GMT+01:00 Glenn Linderman >: > On 1/20/2016

Re: [Python-Dev] Devguide: Add a table summarizing status of Python branches

2016-01-20 Thread Brett Cannon
On Wed, 20 Jan 2016 at 14:28 Victor Stinner wrote: > 2016-01-20 23:01 GMT+01:00 Brett Cannon : > > This is a proposed optional, future feature leading from moving to > GitHub: > > >

Re: [Python-Dev] Update PEP 7 to require curly braces in C

2016-01-20 Thread Brett Cannon
I just checked with Van and we should have CLAs for even PEP contributors, so it will have to go through the same steps as the other ancillary repositories. On Wed, 20 Jan 2016 at 14:41 Brett Cannon wrote: > On Wed, 20 Jan 2016 at 14:31 Guido van Rossum

Re: [Python-Dev] PEP 509: Add a private version to dict

2016-01-20 Thread Victor Stinner
2016-01-21 1:08 GMT+01:00 Brett Cannon : > On Wed, 20 Jan 2016 at 15:46 Victor Stinner >> The worst case is when a value different than the watched value is >> modified between each guard check. In this case, we always need a dict >> lookup. An

Re: [Python-Dev] Devguide: Add a table summarizing status of Python branches

2016-01-20 Thread Victor Stinner
2016-01-21 1:09 GMT+01:00 Brett Cannon : > On Wed, 20 Jan 2016 at 14:28 Victor Stinner >> I'm using the free service ReadTheDocs.org and it's really impressive >> how fast it is to update the HTML page after a push. It's usually less >> than 10 seconds.

Re: [Python-Dev] Code formatter bot

2016-01-20 Thread Ben Finney
francismb writes: > what's your opinion about a code-formatter bot for cpython. What is the proposal? The opinions will surely depend on: * What formatting is to be applied automatically? * If you propose to enforce rigid interpretations of the style-guide PEPs as