Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6bfe293

Browse files
committed
Dataclass
1 parent b338564 commit 6bfe293

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ class <class_name>:
10361036
<attr_name_2>: <type> = <default_value>
10371037
<attr_name_3>: list/dict/set = field(default_factory=list/dict/set)
10381038
```
1039-
* **An object can be made sortable with `'order=True'` or immutable with `'frozen=True'`.**
1039+
* **Objects can be made sortable with `'order=True'` or immutable and hashable with `'frozen=True'`.**
10401040
* **Function field() is needed because `'<attr_name>: list = []'` would make a list that is shared among all instances.**
10411041
* **Default_factory can be any [callable](#callable).**
10421042

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,7 @@
989989

990990

991991
<ul>
992-
<li><strong>An object can be made sortable with <code class="python hljs"><span class="hljs-string">'order=True'</span></code> or immutable with <code class="python hljs"><span class="hljs-string">'frozen=True'</span></code>.</strong></li>
992+
<li><strong>Objects can be made sortable with <code class="python hljs"><span class="hljs-string">'order=True'</span></code> or immutable and hashable with <code class="python hljs"><span class="hljs-string">'frozen=True'</span></code>.</strong></li>
993993
<li><strong>Function field() is needed because <code class="python hljs"><span class="hljs-string">'&lt;attr_name&gt;: list = []'</span></code> would make a list that is shared among all instances.</strong></li>
994994
<li><strong>Default_factory can be any <a href="#callable">callable</a>.</strong></li>
995995
</ul>

0 commit comments

Comments
 (0)