Skip to content

Commit 16c69da

Browse files
committed
little things
1 parent fa60cef commit 16c69da

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

advanced/functions.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,10 @@ and `**kwargs`, and there's no need to avoid them.
244244

245245
I don't recommend using keyword-only arguments with functions like our
246246
`print_box`. It's easy enough to guess what `print_box('hello', '-')`
247-
does, and there's no need to deny that. On the other hand, it's much
248-
harder to guess what `move('file1.txt', 'file2.txt', True, False)` does,
249-
so using keyword-only arguments makes sense and gets rid of the file
250-
deleting problem.
247+
does, and there's no need to deny that. It's much harder to guess what
248+
`move('file1.txt', 'file2.txt', True, False)` does, so using
249+
keyword-only arguments makes sense and also solves the file deleting
250+
problem.
251251

252252
## Summary
253253

basics/classes.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,6 @@ it later?
285285

286286
```py
287287
>>> class Website:
288-
...
289288
... def info(self): # self will be stackoverflow
290289
... print("URL:", self.url)
291290
... print("Founding year:", self.founding_year)
@@ -312,12 +311,10 @@ Maybe we could add a method to do that?
312311

313312
```py
314313
>>> class Website:
315-
...
316314
... def initialize(self, url, founding_year, free_to_use):
317315
... self.url = url
318316
... self.founding_year = founding_year
319317
... self.free_to_use = free_to_use
320-
...
321318
... def info(self):
322319
... print("URL:", self.url)
323320
... print("Founding year:", self.founding_year)
@@ -344,12 +341,10 @@ class with arguments and they will be given to `__init__`. Like this:
344341

345342
```py
346343
>>> class Website:
347-
...
348344
... def __init__(self, url, founding_year, free_to_use):
349345
... self.url = url
350346
... self.founding_year = founding_year
351347
... self.free_to_use = free_to_use
352-
...
353348
... def info(self):
354349
... print("URL:", self.url)
355350
... print("Founding year:", self.founding_year)

0 commit comments

Comments
 (0)