Skip to content
This repository was archived by the owner on Dec 2, 2021. It is now read-only.

Remove charset from CONTENT_TYPE from http_charfinder.py in chapter18 #13

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update clockdeco_param.py
  • Loading branch information
ResolveWang authored Aug 6, 2017
commit eab1e1e7cb558c19bf3bb5898157a1852066a5c9
3 changes: 0 additions & 3 deletions 07-closure-deco/clockdeco_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@

# BEGIN CLOCKDECO_PARAM
import time
import functools

DEFAULT_FMT = '[{elapsed:0.8f}s] {name}({args}) -> {result}'

def clock(fmt=DEFAULT_FMT): # <1>
def decorate(func): # <2>
@functools.wraps(func)
def clocked(*_args): # <3>
t0 = time.time()
_result = func(*_args) # <4>
Expand All @@ -37,7 +35,6 @@ def snooze(seconds):
time.sleep(seconds)

for i in range(3):
print(snooze.__name__)
snooze(.123)

# END CLOCKDECO_PARAM