Re: [Python-ideas] JavaScript-Style Object Creation in Python (using a constructor function instead of a class to create objects)

2017-05-18 Thread Eric V. Smith
On 5/18/17 2:26 PM, Sven R. Kunze wrote: On 17.05.2017 23:29, Ivan Levkivskyi wrote: On 17 May 2017 at 20:09, Sven R. Kunze > wrote: class Foo(dictlike, tuplelike, simpleobject): attribute1: User attribute2: Blog attribute3:

[Python-ideas] Data Classes (was: Re: JavaScript-Style Object Creation in Python (using a constructor function instead of a class to create objects))

2017-05-18 Thread Eric V. Smith
On 5/18/17 2:26 PM, Sven R. Kunze wrote: On 17.05.2017 23:29, Ivan Levkivskyi wrote: the idea is to write it into a PEP and consider API/corner cases/implementation/etc. Who's writing it? Guido, Hynek, and I met today. I'm writing up our notes, and hopefully that will eventually become a

Re: [Python-ideas] fnmatch.filter_false

2017-05-18 Thread tritium-list
> -Original Message- > From: Python-ideas [mailto:python-ideas-bounces+tritium- > list=sdamon@python.org] On Behalf Of Steven D'Aprano > Sent: Thursday, May 18, 2017 9:01 AM > To: python-ideas@python.org > Subject: Re: [Python-ideas] fnmatch.filter_false > > On Thu, May 18, 2017 at

Re: [Python-ideas] JavaScript-Style Object Creation in Python (using a constructor function instead of a class to create objects)

2017-05-18 Thread Sven R. Kunze
On 17.05.2017 23:29, Ivan Levkivskyi wrote: On 17 May 2017 at 20:09, Sven R. Kunze > wrote: class Foo(dictlike, tuplelike, simpleobject): attribute1: User attribute2: Blog attribute3: list def __my_dunder__(self):

Re: [Python-ideas] PEP 526: why ClassVar instead of ClassAttr?

2017-05-18 Thread Ivan Levkivskyi
On 18 May 2017 at 17:25, Brett Cannon wrote: > On Wed, May 17, 2017, 09:33 Ivan Levkivskyi, wrote: > >> On 17 May 2017 at 11:03, Steven D'Aprano wrote: >> >>> On Tue, May 16, 2017 at 10:11:31PM -0700, Guido van Rossum wrote: >>> >

Re: [Python-ideas] PEP 526: why ClassVar instead of ClassAttr?

2017-05-18 Thread Brett Cannon
On Wed, May 17, 2017, 09:33 Ivan Levkivskyi, wrote: > On 17 May 2017 at 11:03, Steven D'Aprano wrote: > >> On Tue, May 16, 2017 at 10:11:31PM -0700, Guido van Rossum wrote: >> > There was another reason too. Many things are "class attributes" e.g. >> >

Re: [Python-ideas] Tighten up the formal grammar and parsing a bit?

2017-05-18 Thread Steven D'Aprano
On Mon, May 15, 2017 at 11:17:48PM +1000, Chris Angelico wrote: > On Mon, May 15, 2017 at 11:00 PM, Steven D'Aprano wrote: > > There's also cases where > > > > if x > y: > > pass > > else: > > code > > > > is *not necessarily* the same as > > > >

Re: [Python-ideas] fnmatch.filter_false

2017-05-18 Thread Steven D'Aprano
On Thu, May 18, 2017 at 12:07:05AM -0400, tritium-l...@sdamon.com wrote: > > At the cost of a slight inefficiency, you could use the pure Python > > equivalent given in the docs: > > > > https://docs.python.org/3/library/fnmatch.html#fnmatch.filter > > > > > > fnmatch.filter(names, pattern) >