Commit Graph

35 Commits

Author SHA1 Message Date
Łukasz Langa fd34bfe484
[3.10] gh-91330: Tests and docs for dataclass descriptor-typed fields (GH-94424) (GH-94577)
Co-authored-by: Erik De Bonte <erikd@microsoft.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 5f319308a8)
2022-07-05 20:45:02 +02:00
Miss Islington (bot) 7445949a43
bpo-43532: add version added to KW_ONLY (GH-31235)
Minor missing version note mentioned at the end of  (and affected me independently before reading that note).

Automerge-Triggered-By: GH:ericvsmith
(cherry picked from commit 5a3f97291e)

Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
2022-02-09 13:18:52 -08:00
Miss Islington (bot) 8bef658668
bpo-46290: Fix parameter names in dataclasses docs (GH-30450)
(cherry picked from commit ef5376e69e)

Co-authored-by: Zsolt Dollenstein <zsol.zsol@gmail.com>
2022-01-08 07:09:40 -08:00
Miss Islington (bot) 32f1491a97
bpo-43905: Expand dataclasses.astuple() and asdict() docs (GH-26154)
Expanded ``astuple()`` docs, warning about deepcopy being applied
and providing a workaround.

Automerge-Triggered-By: GH:ericvsmith
(cherry picked from commit c1f93f0d37)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
2021-11-29 10:32:56 -08:00
Miss Islington (bot) 7aa58f5425
[doc] Reword sentinel object summary in dataclasses (GH-27792)
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>
(cherry picked from commit 767a17f35a)

Co-authored-by: Ville Korhonen <ville@xd.fi>
2021-09-02 09:37:55 -07:00
Miss Islington (bot) f0e2a46349
Fix reST markup in dataclasses.rst (GH-27843) (GH-27845)
The signature of field() had an extraneous colon at the end, causing it
to appear all bold and without the module name.
(cherry picked from commit d26dbba929)

Co-authored-by: Jean-Abou-Samra <37271310+Jean-Abou-Samra@users.noreply.github.com>

Co-authored-by: Jean-Abou-Samra <37271310+Jean-Abou-Samra@users.noreply.github.com>
2021-08-19 16:49:15 -04:00
Miss Islington (bot) f47305aa1f
bpo-43558: Add note about base class initialization to dataclasses doc (GH-25967) (GH-26018)
(cherry picked from commit 2a031723ee)

Co-authored-by: dhoekstra2000 <douwe.hoekstra2512@gmail.com>

Co-authored-by: dhoekstra2000 <douwe.hoekstra2512@gmail.com>
2021-05-10 09:38:46 -04:00
Miss Islington (bot) 70ff820046
Fix a word in dataclasses docs. (GH-26003) (GH-26004)
(cherry picked from commit 801497a115)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2021-05-08 22:22:48 -04:00
Miss Islington (bot) ba5076f34b
Fix minor grammar problems in dataclasses documentation (GH-25948) (GH-25958)
Some missing words; some odd word choices.
(cherry picked from commit ee8e7c2fa9)

Co-authored-by: Scott Noyes <snoyes@gmail.com>

Co-authored-by: Scott Noyes <snoyes@gmail.com>
2021-05-06 17:54:32 -04:00
Eric V. Smith 72720a2639
dataclasses docs: add a missing word. (GH-25839) 2021-05-03 02:33:34 -04:00
Eric V. Smith a21b3d2fa2
More clarification of kw_only args. (GH-25838)
Also, clarify that the dataclass decorator is what raises an error for some mutable defaults.
2021-05-03 01:55:13 -04:00
Raymond Hettinger 4ae828f3c0
Fix invalid markup (#25833) 2021-05-02 21:07:29 -07:00
Eric V. Smith 821f0c8c39
More work on documenting dataclass keyword-only fields. (GH-25828) 2021-05-02 21:20:50 -04:00
Shreyan Avigyan a5eabc9a39
bpo-43997: Add versionadded directives for to match_args, kw_only, and slots in dataclasses.dataclasses documentation (GH-25803) 2021-05-02 08:43:50 -07:00
Eric V. Smith 318ca1764c
Minor tweaks to dataclasses keyword-only fields documentation. (GH-25801) 2021-05-01 21:46:05 -04:00
Eric V. Smith 2f59a767bc
Improve the dataclasses kw_only documentation. (GH-25799) 2021-05-01 19:51:12 -04:00
Yurii Karabas c24199184b
bpo-42269: Add slots parameter to dataclass decorator (GH-24171)
Add slots parameter to dataclass decorator and make_dataclass function.
2021-04-30 22:14:30 -04:00
Mohamed Moselhy e726a902b7
bpo-43971: Add spaces around annotated arg default '=' (GH-25702)
Result: "quantity_on_hand: int = 0".
2021-04-30 19:06:55 -04:00
Llandy Riveron Del Risco 8a307e488d
bpo-43938: improve dataclasses.FrozenInstanceError documentation (GH-25603) 2021-04-26 14:53:28 -04:00
Eric V. Smith c0280532dc
Add keyword-only fields to dataclasses. (GH=25608) 2021-04-25 20:42:39 -04:00
Eric V. Smith 750f484752
bpo-43764: Add match_args=False parameter to dataclass decorator and to make_dataclasses function. (GH-25337)
Add match_args=False parameter to dataclass decorator and to make_dataclass function.
2021-04-10 21:28:42 -04:00
Guilherme Martins Crocetti 0554044ddc
bpo-43415: Fix typo on dataclasses.rst (#24789) 2021-03-08 17:50:39 -05:00
Andre Delfino 7f54e563dc
[doc] Use list[int] instead of List[int] (etc.) in a few more places (GH-22524)
This changes a few occurrences left behind by #22340.

Automerge-Triggered-By: @gvanrossum
2020-10-03 15:10:59 -07:00
marload 61bb24a270
bpo-41199: Docstring convention not followed for dataclasses documentation page (GH-21413)
Automerge-Triggered-By: @ericvsmith
2020-07-09 05:13:47 -07:00
Ned Batchelder 2effef7453
Make the first dataclass example more useful (GH-19994) 2020-05-08 04:39:57 -07:00
Fabio Sangiovanni e28aff54d9 bpo-33961: Adjusted dataclasses docs to correct exceptions raised. (GH-7917) (GH-17677) 2019-12-25 17:45:30 -05:00
Serhiy Storchaka 138ccbb022
bpo-38738: Fix formatting of True and False. (GH-17083)
* "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>".
2019-11-12 16:57:03 +02:00
Serhiy Storchaka 2d88e63bfc
bpo-37163: Make the obj argument of dataclasses.replace() a positional-only. (GH-14390) 2019-06-26 19:07:44 +03:00
Cheryl Sabella b7105c9c96 bpo-35566: Add links to annotation glossary term (GH-11291) 2018-12-23 21:09:09 -08:00
방성범 (Bang Seongbeom) 508d820512 Fix astuple in dataclasses documentation (GH-9631) 2018-09-29 06:50:31 -04:00
Daniel Dương 075b3c3259 Fix typo in the dataclasses's doc (GH-8896) 2018-08-24 05:19:24 -04:00
Tom Faulkner da5e9476bb Dataclasses: Fix example on 30.6.8, add method should receive a list rather than an integer. (GH-8038)
Change example function to append rather than add lists.
2018-07-10 22:39:57 -04:00
Barry Warsaw 713a936736
bpo-32216: Update dataclasses documentation (#6913) 2018-05-16 15:50:07 -04:00
Eric V. Smith 7a1c027501
Minor tweaks to dataclasses docs. (GH-6903) 2018-05-16 09:29:05 -04:00
Eric V. Smith 98d50cb8f5
bpo-32216: Add documentation for dataclasses (GH-6886)
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.
2018-05-16 04:20:43 -04:00