Re: [Python-ideas] Where should grouping() live (was: grouping / dict of lists)

2018-07-05 Thread David Mertz
Yes, he said a definite no to a built-in. But he expressed a less specific lack of enthusiasm for collections classes (including Counter, which exists and which I personally use often). On Thu, Jul 5, 2018, 1:16 AM Chris Barker wrote: > On Tue, Jul 3, 2018 at 6:23 AM, David Mertz wrote: > >> Gu

[Python-ideas] Add `rc` to distutils.version.StrictVersion

2018-07-05 Thread Pål Grønås Drange
StrictVersion from distutils accepts version tags like 1.14.0 1.14.0a1 1.14.0b2 but not 1.14.0rc1 (nor 1.14.0c1). My suggestion: Add `rc` in the regexp and make it a `prerelease` (the latter comes for free by the current implementation). Most package maintainers have adopted the `rc` abbreviati

[Python-ideas] Add new `Symbol` type

2018-07-05 Thread Flavio Curella
More than once I've found myself wanting to create a 'sentinel' value. The most common use case is to differentiate between an argument that has not been provided, and an argument provided with the value `None`. This would be solvable by implementing something similar to what JavaScript calls [`Sy

Re: [Python-ideas] Add new `Symbol` type

2018-07-05 Thread Ed Kellett
Hi! On 2018-07-05 20:38, Flavio Curella wrote: > More than once I've found myself wanting to create a 'sentinel' value. The > most common use case is to differentiate between an argument that has not > been provided, and an argument provided with the value `None`. I generally do something like

Re: [Python-ideas] Add new `Symbol` type

2018-07-05 Thread Joseph Jevnik
I have also wanted sentinel objects many times. These are often useful for creating a "Not Specified" default value when explicitly passing `None` has semantic meaning. There are a few issues with the `sentinel = object()` code. One is that they don't repr well so they make debugging harder. Anoth

Re: [Python-ideas] Add new `Symbol` type

2018-07-05 Thread Flavio Curella
> What functionality does such a thing actually need? I think the requirements should be: * The resulting symbol behave exactly like None. IE: the symbol should not be an instance of object, but an instance of its own class * A symbol can optionally be globally unique. * Two symbols created by the

Re: [Python-ideas] Where should grouping() live (was: grouping / dict of lists)

2018-07-05 Thread Chris Barker via Python-ideas
On Thu, Jul 5, 2018 at 3:26 AM, David Mertz wrote: > Yes, he said a definite no to a built-in. But he expressed a less specific > lack of enthusiasm for collections classes (including Counter, which exists > and which I personally use often). > And a Grouping class would do more than Counter, wh

Re: [Python-ideas] Add new `Symbol` type

2018-07-05 Thread Nathaniel Smith
On Thu, Jul 5, 2018 at 1:25 PM, Flavio Curella wrote: > >> What functionality does such a thing actually need? > > I think the requirements should be: > * The resulting symbol behave exactly like None. IE: the symbol should not > be an instance of object, but an instance of its own class > * A sym

Re: [Python-ideas] Add new `Symbol` type

2018-07-05 Thread Steven D'Aprano
On Thu, Jul 05, 2018 at 02:38:47PM -0500, Flavio Curella wrote: > More than once I've found myself wanting to create a 'sentinel' value. The > most common use case is to differentiate between an argument that has not > been provided, and an argument provided with the value `None`. [...] > Is this s