Wei-Hsiang (Matt) Wang
d47d7e1124
[3.12] gh-123517: Remove unnecessary :meth: parentheses (gh-123518) (GH-123576)
2024-09-02 16:02:39 +02:00
Miss Islington (bot)
ae17f9b0d0
[3.12] gh-123570: Add link to weakref.ref from weakref_slot docs in dataclasses (GH-123571) ( #123595 )
...
gh-123570: Add link to `weakref.ref` from `weakref_slot` docs in `dataclasses` (GH-123571)
(cherry picked from commit c3ed775899 )
Co-authored-by: sobolevn <mail@sobolevn.me>
2024-09-02 07:05:18 +00:00
Miss Islington (bot)
12db938d43
[3.12] gh-91126: Docs and tests for slotted dataclasses with __init_subclass__ (GH-123342) ( #123569 )
...
gh-91126: Docs and tests for slotted dataclasses with `__init_subclass__` (GH-123342)
(cherry picked from commit 75e72822a3 )
Co-authored-by: sobolevn <mail@sobolevn.me>
2024-09-01 10:44:15 +00:00
Miss Islington (bot)
681d7da144
[3.12] gh-119260: Clarify is_dataclass Behavior for Subclasses in Documentation and Tests (GH-119480) ( #119761 )
...
gh-119260: Clarify is_dataclass Behavior for Subclasses in Documentation and Tests (GH-119480)
(cherry picked from commit bf4ff3ad2e )
Co-authored-by: Aditya Borikar <adityaborikar2@gmail.com>
Co-authored-by: Carl Meyer <carl@oddbird.net>
2024-05-30 03:24:50 +00:00
Miss Islington (bot)
ddaed629f4
[3.12] gh-90562: Mention slots pitfall in dataclass docs (GH-107391) ( #119351 )
...
Co-authored-by: Josh Cannon <joshdcannon@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-05-23 00:16:23 -06:00
Miss Islington (bot)
cdccafb2d4
[3.12] gh-108267 Fix another dataclasses docs typo (GH-119277) ( #119280 )
...
gh-108267 Fix another dataclasses docs typo (GH-119277)
(cherry picked from commit 423bbcbbc4 )
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-05-20 18:48:54 -04:00
Miss Islington (bot)
a3db4e8f96
[3.12] gh-108267: Fix object.__setattr__ regression in dataclasses docs (GH-119082) ( #119098 )
...
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2024-05-16 13:46:20 +00:00
Serhiy Storchaka
530c3bb271
[3.12] Format None, True, False and NotImplemented as literals (GH-118758) (GH-118794)
...
(cherry picked from commit 05c2fe1acd )
2024-05-08 19:55:13 +00:00
Miss Islington (bot)
a00dd31ee7
[3.12] Doc: mark up classes, attributes, parameters, and methods in dataclasses.rst (GH-117820) ( #117877 )
...
(cherry picked from commit e01831760e )
Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-04-14 17:00:00 +00:00
Miss Islington (bot)
1bf2d4be7e
[3.12] Tweak wording for dataclasses.replace (gh-117758) ( #117876 )
...
(cherry picked from commit e7cce2a9c6 )
Co-authored-by: Gouvernathor <44340603+Gouvernathor@users.noreply.github.com>
2024-04-14 16:52:44 +00:00
Miss Islington (bot)
b6cb36574d
[3.12] dataclasses docs: add some link anchors (GH-117601) ( #117863 )
...
dataclasses docs: add some link anchors (GH-117601)
(cherry picked from commit c99d374fc7 )
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-04-14 08:10:07 +00:00
Miss Islington (bot)
efeb8a24b8
[3.12] Simpler example of shallow dict export of a dataclass (GH-117812) ( #117862 )
...
Simpler example of shallow dict export of a dataclass (GH-117812)
(cherry picked from commit f303651b45 )
Co-authored-by: Gouvernathor <44340603+Gouvernathor@users.noreply.github.com>
2024-04-14 00:22:35 +00:00
Carol Willing
1d0e22e500
[3.12] docs:fix over-linking in dataclasses.rst (GH-117005) ( #117163 )
...
* docs: fix over-linking in dataclasses.rst (#117005 )
(cherry picked from commit 0907871d43 )
* [3.12] docs: fix over-linking in dataclasses.rst (GH-117005)
(cherry picked from commit 0907871d43 )
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
---------
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2024-03-22 19:12:00 +00:00
Miss Islington (bot)
0d5455fc7f
[3.12] gh-116535: Fix distracting "TypeError" in example code (gh-116538) (gh-116551)
...
gh-116535: Fix distracting "TypeError" in example code (gh-116538)
(cherry picked from commit db8f423f58 )
Co-authored-by: Declan <5962877+dec1@users.noreply.github.com>
2024-03-09 17:08:12 -05:00
Miss Islington (bot)
12c6424205
[3.12] gh-88531 Fix dataclass __post_init__/__init__ interplay documentation (gh-107404) ( #114162 )
...
* Simplify __post_init__ example usage. It applies to all base classes, not just dataclasses.
(cherry picked from commit 05008c27b7 )
Co-authored-by: Steffen Zeile <48187781+Kaniee@users.noreply.github.com>
2024-01-17 01:33:02 +00:00
Ezio Melotti
7d5a982609
[3.12] gh-110631: Fix reST indentation (GH-110724) ( #110738 )
...
* Fix wrong indentation in the other dirs.
* Fix more wrong indentation..
(cherry picked from commit 718391f475 )
2023-10-11 23:12:36 +02:00
Miss Islington (bot)
3aa7df6544
[3.12] gh-108267: Dataclasses docs: Fix object.__setattr__ typo (GH-108355) ( #108358 )
...
gh-108267: Dataclasses docs: Fix object.__setattr__ typo (GH-108355)
Fixed a sentence in dataclasses.rst
Changed "__setattr__" to "object.__setattr__" in a section that was specifically supposed to refer to the __setattr__ method of the object class. Also suppressed the link to the data model docs for __setattr__, since we're talking about a specific __setattr__ implementation, not __setattr__ methods in general.
(cherry picked from commit 79fdacc005 )
Co-authored-by: FrozenBob <30644137+FrozenBob@users.noreply.github.com>
2023-08-23 13:46:03 +02:00
Miss Islington (bot)
ea6a4b7523
[3.12] gh-106107: document correct error that's raised when a mutable default value for a field is detected (gh-106109) (gh-106115)
...
gh-106107: document correct error that's raised when a mutable default value for a field is detected (gh-106109)
(cherry picked from commit 512f299e55 )
Co-authored-by: Roderich Schupp <roderich.schupp@gmail.com>
2023-06-26 14:12:52 -04:00
Olga Matoula
83aa496f81
gh-101100: Add reference doc for __post_init__ ( #103818 )
...
Signed-off-by: Olga Matoula <olgamatoula@gmail.com>
2023-04-28 13:10:26 -06:00
Olga Matoula
0f23eda4b9
gh-103810: Fix broken references in dataclasses ( #103811 )
...
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-04-25 01:26:18 +02:00
Allan Lago
7ef614c1ad
gh-91687: modernize dataclass example typing ( #103773 )
...
modernize dataclass example typing `list` rather than `List` and comment as to that line being the alluded too error.
2023-04-24 10:16:23 -07:00
Nikita Sobolev
b48be8fa18
gh-102103: add module argument to dataclasses.make_dataclass ( #102104 )
2023-03-10 17:26:46 -07:00
Akshit Tyagi
659c2607f5
gh-99026 update dataclasses docs for when annotations are inspected (gh-100798)
...
update dataclasses docs for when annotations are inspected
2023-01-06 09:26:44 -05:00
Ram Rachum
51ee0a29e9
dataclasses.rst: Prevent horizontal scrolling (gh-100025)
2022-12-05 13:56:13 -05:00
Shantanu
880bafc574
gh-98576: Fix types in dataclass.InitVar example (gh-98577)
2022-10-31 11:02:02 -04:00
FC Stegerman
d10c2b9742
dataclasses docs: consistent indentation (4 spaces) in examples ( #98855 )
2022-10-29 18:06:52 +01:00
Stanley
268129a74f
docs: Change links to label refs ( #98454 )
...
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-10-25 20:26:28 -07:00
Erik De Bonte
5f319308a8
gh-91330: Tests and docs for dataclass descriptor-typed fields (GH-94424)
...
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2022-07-05 20:09:41 +02:00
Eric V. Smith
5f9c0f5ddf
Add weakref_slot to dataclass decorator, to allow instances with slots to be weakref-able. ( #92160 )
2022-05-02 10:36:39 -06:00
Arie Bovenberg
82e9b0bb0a
bpo-46382 dataclass(slots=True) now takes inherited slots into account (GH-31980)
...
Do not include any members in __slots__ that are already in a base class's __slots__.
2022-03-19 17:01:17 -04:00
Henry Schreiner
5a3f97291e
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
2022-02-09 12:56:10 -08:00
Zsolt Dollenstein
ef5376e69e
bpo-46290: Fix parameter names in dataclasses docs (GH-30450)
2022-01-08 12:56:35 +02:00
Andre Delfino
d0669c5e69
Remove erroneous padding in dataclasses (GH-30076)
...
Automerge-Triggered-By: GH:ericvsmith
2021-12-12 10:05:48 -08:00
Eric V. Smith
e029c53e1a
bpo-44674: Use unhashability as a proxy for mutability for default dataclass __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.
2021-12-11 16:12:17 -05:00
andrei kulakov
c1f93f0d37
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
2021-11-29 10:10:32 -08:00
Ville Korhonen
767a17f35a
[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>
2021-09-02 18:03:22 +02:00
Jean-Abou-Samra
d26dbba929
Fix reST markup in dataclasses.rst (GH-27843)
...
The signature of field() had an extraneous colon at the end, causing it
to appear all bold and without the module name.
2021-08-19 16:47:16 -04:00
thomkeh
aa0e4a64b0
Fix typo in dataclasses documentation ( #27360 )
...
"affect" -> "effect"
2021-07-26 08:39:45 -04:00
dhoekstra2000
2a031723ee
bpo-43558: Add note about base class initialization to dataclasses doc (GH-25967)
2021-05-10 09:30:22 -04:00
Eric V. Smith
801497a115
Fix a word in dataclasses docs. (GH-26003)
2021-05-08 22:20:04 -04:00
Scott Noyes
ee8e7c2fa9
Fix minor grammar problems in dataclasses documentation (GH-25948)
...
Some missing words; some odd word choices.
2021-05-06 17:52:46 -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