summaryrefslogtreecommitdiffstats
path: root/Doc/library/dataclasses.rst
Commit message (Collapse)AuthorAgeFilesLines
* Add weakref_slot to dataclass decorator, to allow instances with slots to be ↵Eric V. Smith2022-05-021-5/+12
| | | | weakref-able. (#92160)
* bpo-46382 dataclass(slots=True) now takes inherited slots into account ↵Arie Bovenberg2022-03-191-0/+10
| | | | | (GH-31980) Do not include any members in __slots__ that are already in a base class's __slots__.
* bpo-43532: add version added to KW_ONLY (GH-31235)Henry Schreiner2022-02-091-0/+2
| | | | | Minor missing version note mentioned at the end of (and affected me independently before reading that note). Automerge-Triggered-By: GH:ericvsmith
* bpo-46290: Fix parameter names in dataclasses docs (GH-30450)Zsolt Dollenstein2022-01-081-12/+12
|
* Remove erroneous padding in dataclasses (GH-30076)Andre Delfino2021-12-121-63/+63
| | | Automerge-Triggered-By: GH:ericvsmith
* bpo-44674: Use unhashability as a proxy for mutability for default dataclass ↵Eric V. Smith2021-12-111-3/+9
| | | | | __init__ arguments. (GH-29867) `@dataclass` in 3.10 prohibits using list, dict, or set as default values. It does this to avoid the mutable default problem. This test is both too strict, and not strict enough. Too strict, because some immutable subclasses should be safe, and not strict enough, because other mutable types should be prohibited. With this change applied, `@dataclass` now uses unhashability as a proxy for mutability: if objects aren't hashable, they're assumed to be mutable.
* bpo-43905: Expand dataclasses.astuple() and asdict() docs (GH-26154)andrei kulakov2021-11-291-4/+18
| | | | | | Expanded ``astuple()`` docs, warning about deepcopy being applied and providing a workaround. Automerge-Triggered-By: GH:ericvsmith
* [doc] Reword sentinel object summary in dataclasses (GH-27792)Ville Korhonen2021-09-021-4/+3
| | | | | This sentinel value (`MISSING`) is also used as default value for the `kw_only` parameter introduced in Python 3.10. It's cleaner to simply omit the usage here. Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* Fix reST markup in dataclasses.rst (GH-27843)Jean-Abou-Samra2021-08-191-1/+1
| | | | The signature of field() had an extraneous colon at the end, causing it to appear all bold and without the module name.
* Fix typo in dataclasses documentation (#27360)thomkeh2021-07-261-1/+1
| | | "affect" -> "effect"
* bpo-43558: Add note about base class initialization to dataclasses doc ↵dhoekstra20002021-05-101-0/+21
| | | | (GH-25967)
* Fix a word in dataclasses docs. (GH-26003)Eric V. Smith2021-05-091-1/+1
|
* Fix minor grammar problems in dataclasses documentation (GH-25948)Scott Noyes2021-05-061-7/+7
| | | Some missing words; some odd word choices.
* dataclasses docs: add a missing word. (GH-25839)Eric V. Smith2021-05-031-1/+1
|
* More clarification of kw_only args. (GH-25838)Eric V. Smith2021-05-031-13/+20
| | | Also, clarify that the dataclass decorator is what raises an error for some mutable defaults.
* Fix invalid markup (#25833)Raymond Hettinger2021-05-031-2/+1
|
* More work on documenting dataclass keyword-only fields. (GH-25828)Eric V. Smith2021-05-031-16/+40
|
* bpo-43997: Add versionadded directives for to match_args, kw_only, and slots ↵Shreyan Avigyan2021-05-021-0/+8
| | | | in dataclasses.dataclasses documentation (GH-25803)
* Minor tweaks to dataclasses keyword-only fields documentation. (GH-25801)Eric V. Smith2021-05-021-5/+5
|
* Improve the dataclasses kw_only documentation. (GH-25799)Eric V. Smith2021-05-011-13/+28
|
* bpo-42269: Add slots parameter to dataclass decorator (GH-24171)Yurii Karabas2021-05-011-5/+10
| | | Add slots parameter to dataclass decorator and make_dataclass function.
* bpo-43971: Add spaces around annotated arg default '=' (GH-25702)Mohamed Moselhy2021-04-301-1/+1
| | | Result: "quantity_on_hand: int = 0".
* bpo-43938: improve dataclasses.FrozenInstanceError documentation (GH-25603)Llandy Riveron Del Risco2021-04-261-1/+1
|
* Add keyword-only fields to dataclasses. (GH=25608)Eric V. Smith2021-04-261-6/+36
|
* bpo-43764: Add match_args=False parameter to dataclass decorator and to ↵Eric V. Smith2021-04-111-5/+14
| | | | | make_dataclasses function. (GH-25337) Add match_args=False parameter to dataclass decorator and to make_dataclass function.
* bpo-43415: Fix typo on dataclasses.rst (#24789)Guilherme Martins Crocetti2021-03-081-1/+1
|
* [doc] Use list[int] instead of List[int] (etc.) in a few more places (GH-22524)Andre Delfino2020-10-031-2/+2
| | | | | This changes a few occurrences left behind by #22340. Automerge-Triggered-By: @gvanrossum
* bpo-41199: Docstring convention not followed for dataclasses documentation ↵marload2020-07-091-1/+1
| | | | | page (GH-21413) Automerge-Triggered-By: @ericvsmith
* Make the first dataclass example more useful (GH-19994)Ned Batchelder2020-05-081-0/+2
|
* bpo-33961: Adjusted dataclasses docs to correct exceptions raised. (GH-7917) ↵Fabio Sangiovanni2019-12-251-3/+4
| | | | (GH-17677)
* bpo-38738: Fix formatting of True and False. (GH-17083)Serhiy Storchaka2019-11-121-3/+3
| | | | | | | | | * "Return true/false" is replaced with "Return ``True``/``False``" if the function actually returns a bool. * Fixed formatting of some True and False literals (now in monospace). * Replaced "True/False" with "true/false" if it can be not only bool. * Replaced some 1/0 with True/False if it corresponds the code. * "Returns <bool>" is replaced with "Return <bool>".
* bpo-37163: Make the obj argument of dataclasses.replace() a positional-only. ↵Serhiy Storchaka2019-06-261-1/+1
| | | | (GH-14390)
* bpo-35566: Add links to annotation glossary term (GH-11291)Cheryl Sabella2018-12-241-3/+3
|
* Fix astuple in dataclasses documentation (GH-9631)방성범 (Bang Seongbeom)2018-09-291-1/+1
|
* Fix typo in the dataclasses's doc (GH-8896)Daniel Dương2018-08-241-1/+1
|
* Dataclasses: Fix example on 30.6.8, add method should receive a list rather ↵Tom Faulkner2018-07-111-1/+1
| | | | | | than an integer. (GH-8038) Change example function to append rather than add lists.
* bpo-32216: Update dataclasses documentation (#6913)Barry Warsaw2018-05-161-75/+79
|
* Minor tweaks to dataclasses docs. (GH-6903)Eric V. Smith2018-05-161-3/+3
|
* bpo-32216: Add documentation for dataclasses (GH-6886)Eric V. Smith2018-05-161-0/+588
This is an initial version that likely requires much polishing. I'm adding it lay out the structure and so we have something to start working from.