Skip to content

Commit

Permalink
time: Add __reduce__ to make UTC object pickleable.
Browse files Browse the repository at this point in the history
  • Loading branch information
shakefu committed Apr 17, 2018
1 parent 4ae8d26 commit 3843259
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pytool/time.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ def dst(self, stamp):
def __repr__(self):
return 'UTC()'

def __reduce__(self):
# This method makes the UTC object pickleable
return UTC, ()


def is_dst(stamp):
""" Return ``True`` if `stamp` is daylight savings.
Expand Down

0 comments on commit 3843259

Please sign in to comment.