Re: [Python-ideas] Are we supposed to be able to have our own class dictionary in python 3?

2018-11-04 Thread Daniel Moisset
I think the documentation is correct but you misinterpreted the intent of that code. The code you're quoting, which is an example, is not about ending up with a custom dict within the instance, the intent of the author was just to captur the memeber_names list. So what it does for that is customizi

[Python-ideas] Proposal to add a key field to the bisect library

2018-11-04 Thread Tiberiu Chibici
Hi, I would like to propose an improvement to the functions in the bisect library, to add a 'key' parameter, similar to 'sorted' or other system functions. -- Chibici Tiberiu ___ Python-ideas mailing list [email protected] https://mail.python.org/

Re: [Python-ideas] Proposal to add a key field to the bisect library

2018-11-04 Thread Steven D'Aprano
On Sun, Nov 04, 2018 at 02:20:31PM +0200, Tiberiu Chibici wrote: > Hi, > I would like to propose an improvement to the functions in the bisect > library, to add a 'key' parameter, similar to 'sorted' or other system > functions. Quoting the bug tracker: This request has come up repeatedly (an

Re: [Python-ideas] Proposal to add a key field to the bisect library

2018-11-04 Thread Steven D'Aprano
On Mon, Nov 05, 2018 at 12:19:49AM +1100, Steven D'Aprano wrote: > On Sun, Nov 04, 2018 at 02:20:31PM +0200, Tiberiu Chibici wrote: > > Hi, > > I would like to propose an improvement to the functions in the bisect > > library, to add a 'key' parameter, similar to 'sorted' or other system > > functi

Re: [Python-ideas] Serialization of CSV vs. JSON

2018-11-04 Thread David Shawley
On Nov 3, 2018, at 5:43 PM, Greg Ewing wrote: > David Shawley wrote: > > I'm +1 on adding support for serializing datetime.date and > > datetime.datetime *but* I'm -1 on automatically deserializing anything that > > looks like a ISO-8601 in json.load*. The asymmetry is the only thing that > > ke

Re: [Python-ideas] Proposal to add a key field to the bisect library

2018-11-04 Thread Anders Hovmöller
That link has Guido and Raymond Hettinger ending +1 and looking to either add it or writing a simple copy paste:able recipe to the docs. I mean, that's how I read it, did you read that and come to a different impression? > On 4 Nov 2018, at 14:19, Steven D'Aprano wrote: > >> On Sun, Nov 04, 2

Re: [Python-ideas] Proposal to add a key field to the bisect library

2018-11-04 Thread Anders Hovmöller
Oh heh. Well there we go :) > On 4 Nov 2018, at 14:33, Steven D'Aprano wrote: > >> On Mon, Nov 05, 2018 at 12:19:49AM +1100, Steven D'Aprano wrote: >>> On Sun, Nov 04, 2018 at 02:20:31PM +0200, Tiberiu Chibici wrote: >>> Hi, >>> I would like to propose an improvement to the functions in the bise

Re: [Python-ideas] Serialization of CSV vs. JSON

2018-11-04 Thread Wes Turner
Here's a JSONEncoder subclass with a default method that checks variable types in a defined sequence that includes datetime: https://gist.github.com/majgis/4200488 Passing an ordered map of (Type, fn) may or may not be any more readable than simply subclassing JSONEncoder and defining .default().