[Python-Dev] PEP 557: Data Classes
Eric V. Smith
eric at trueblade.com
Fri Sep 8 12:24:16 EDT 2017
On 9/8/17 9:07 AM, Eric V. Smith wrote:
> Hah! Thanks for the catch.
I've pushed a fix to the PEP repo, it should show up online shortly.
> There is no C in my happy place.
>> 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!
>>> 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:
>> class C:
>> int a # 'a' has no default value
>> int b = 0 # assign a default value for 'b'
> Python-Dev mailing list
> Python-Dev at python.org
> Unsubscribe: https://mail.python.org/mailman/options/python-dev/eric%2Ba-python-dev%40trueblade.com
More information about the Python-Dev