[Python-Dev] Second post: PEP 557, Data Classes (original) (raw)
Brett Cannon brett at python.org
Sun Nov 26 13:04:23 EST 2017
- Previous message (by thread): [Python-Dev] Second post: PEP 557, Data Classes
- Next message (by thread): [Python-Dev] Second post: PEP 557, Data Classes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Sat, Nov 25, 2017, 14:00 Eric V. Smith, <eric at trueblade.com> wrote:
The updated version should show up at https://www.python.org/dev/peps/pep-0557/ shortly.
The major changes from the previous version are: - Add InitVar to specify initialize-only fields. _- Renamed dataclasspostinit() to postinit(). - Rename cmp to compare. - Added eq, separate from compare, so you can test unorderable items for equality. - Flushed out asdict() and astuple(). - Changed replace() to just call init(), and dropped the complex post-create logic.
It looks great and I'm excited to get to start using this PEP!
The only open issues I know of are: - Should object comparison require an exact match on the type? https://github.com/ericvsmith/dataclasses/issues/51
I say don't require the type comparison for duck typing purposes.
-Brett
- Should the replace() function be renamed to something else? https://github.com/ericvsmith/dataclasses/issues/77
Most of the items that were previously discussed on python-dev were discussed in detail at https://github.com/ericvsmith/dataclasses. Before rehashing an old discussion, please check there first. Also at https://github.com/ericvsmith/dataclasses is an implementation, with tests, that should work with 3.6 and 3.7. The only action item for the code is to clean up the implementation of InitVar, but that's waiting for PEP 560. Oh, and if PEP 563 is accepted I'll also need to do some work. Feedback is welcomed! Eric.
Python-Dev mailing list Python-Dev at python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/brett%40python.org -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20171126/14fbe82a/attachment.html>
- Previous message (by thread): [Python-Dev] Second post: PEP 557, Data Classes
- Next message (by thread): [Python-Dev] Second post: PEP 557, Data Classes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]