[Python-Dev] PEP 557: Data Classes (original) (raw)
Eric V. Smith eric at trueblade.com
Fri Sep 8 12:07:42 EDT 2017
- Previous message (by thread): [Python-Dev] PEP 557: Data Classes
- Next message (by thread): [Python-Dev] PEP 557: Data Classes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hah! Thanks for the catch.
There is no C in my happy place.
-- Eric.
On Sep 8, 2017, at 8:52 AM, Paul Moore <p.f.moore at gmail.com> wrote:
On 8 September 2017 at 15:57, Eric V. Smith <eric at trueblade.com> wrote: I've written a PEP for what might be thought of as "mutable namedtuples with defaults, but not inheriting tuple's behavior" (a mouthful, but it sounded simpler when I first thought of it). It's heavily influenced by the attrs project. It uses PEP 526 type annotations to define fields. [...] The PEP is largely complete, but could use some filling out in places. Comments welcome!
Eric. P.S. I wrote this PEP when I was in my happy place. Looks good! One minor point - apparently in your happy place, C and Python have the same syntax :-) """ field's may optionally specify a default value, using normal Python syntax: @dataclass class C: int a # 'a' has no default value int b = 0 # assign a default value for 'b' """
- Previous message (by thread): [Python-Dev] PEP 557: Data Classes
- Next message (by thread): [Python-Dev] PEP 557: Data Classes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]