[Python-ideas] Dataclasses, keyword args, and inheritance

2018-01-22 Thread George Leslie-Waksman
The proposed implementation of dataclasses prevents defining fields with defaults before fields without defaults. This can create limitations on logical grouping of fields and on inheritance. Take, for example, the case: @dataclass class Foo: some_default: dict = field(default_factory=dict)

Re: [Python-ideas] Official site-packages/test directory

2018-01-22 Thread Nick Coghlan
On 20 January 2018 at 04:39, Chris Barker wrote: > So maybe the way to go is to come up with recommendations for a standard way > to do it -- maybe published by PyPa? I don't think the trade-offs here are clear enough for us to add an opinionated guide to packaging.python.org, but it could be an

Re: [Python-ideas] Support WHATWG versions of legacy encodings

2018-01-22 Thread Rob Speer
I don't really understand what you're doing when you take a fragment of my sentence where I explain a wrong understanding of WHATWG encodings, and say "that's wrong, as you explain". I know it's wrong. That's what I was saying. You quoted the part where I said "Filling in all the gaps with Latin-1

Re: [Python-ideas] __vars__ special method

2018-01-22 Thread Steven D'Aprano
On Mon, Jan 22, 2018 at 09:20:16AM -0500, Yahya Abou 'Imran via Python-ideas wrote: > On top of this old proposition: > https://bugs.python.org/issue13290 > > We could have a __vars__ method that would be called by vars() if defined. > The use cases: > > 1. let vars() work with instances without

[Python-ideas] __vars__ special method

2018-01-22 Thread Yahya Abou 'Imran via Python-ideas
On top of this old proposition: https://bugs.python.org/issue13290 We could have a __vars__ method that would be called by vars() if defined. The use cases: 1. let vars() work with instances without __dict__; 2. hide some attributes from the public API. Example for 1: class C: __slots__