Skip to content

Instantly share code, notes, and snippets.

@philstrong
Created July 11, 2017 18:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philstrong/1836fb0f6fa880ce63d90cbca0e52bfd to your computer and use it in GitHub Desktop.
Save philstrong/1836fb0f6fa880ce63d90cbca0e52bfd to your computer and use it in GitHub Desktop.
def is_mike_pto(dt):
pto_start, pto_end = (7, 17), (7, 21)
if pto_start <= dt <= pto_end:
return "PTO"
else:
return "Not on PTO"
for day in range(16, 23):
day = (7, day)
pto_status = is_mike_pto(day)
print("2017-{}-{} {}".format(day[0], day[1], pto_status))
1 Comment
@philstrong
Copy link
Author

Please review this Whack Code

@alexander-conn
Copy link

for day in range(16, 23):
    day = (7, day)

I think my one complaint is that we have this reassignment and type change for the day variable. While it works and is pretty understandable as is, I think a rename here would prevent future maintainability issues

@michaelhans
Copy link

I agree the type change is disgusting and I think pep/emacs fly-check would have caught it had I been in python major mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment