mirror of
https://github.com/charlax/professional-programming.git
synced 2025-08-16 18:15:40 +08:00
Run pre-commit on all files
This commit is contained in:
@ -1,19 +1,21 @@
|
||||
from collections import namedtuple
|
||||
|
||||
Bread = namedtuple('Bread', 'color')
|
||||
Bread = namedtuple("Bread", "color")
|
||||
|
||||
|
||||
class ToastException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
def toast(bread):
|
||||
try:
|
||||
put_in_toaster(bread)
|
||||
except:
|
||||
raise ToastException('Could not toast bread')
|
||||
raise ToastException("Could not toast bread")
|
||||
|
||||
|
||||
def put_in_toaster(bread):
|
||||
brad.color = 'light_brown' # Note the typo
|
||||
brad.color = "light_brown" # Note the typo
|
||||
|
||||
|
||||
toast(Bread('yellow'))
|
||||
toast(Bread("yellow"))
|
||||
|
Reference in New Issue
Block a user