Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite007beb

Browse files
authored
Exploit the opportunity for using a dataclass
1 parent629a21e commite007beb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎README.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -576,12 +576,12 @@ print(new_name) # ['Ryan', 'McDermott']
576576

577577
**Also good**
578578
```python
579+
from dataclassesimport dataclass
580+
581+
@dataclass
579582
classPerson:
580583
name:str
581-
582-
def__init__(self,name:str):
583-
self.name= name
584-
584+
#########
585585
@property
586586
defname_as_first_and_last(self) ->list:
587587
returnself.name.split()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp