Skip to content

Commit

Permalink
Merge branch 'master' of github.com:mahmoud/boltons
Browse files Browse the repository at this point in the history
  • Loading branch information
mahmoud committed Feb 26, 2017
2 parents 5660942 + 9a82371 commit 16e082f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions boltons/urlutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,15 +232,14 @@ class cachedproperty(object):
allows the cache to be cleared with :func:`delattr`, or through
manipulating the object's ``__dict__``.
"""

def __init__(self, func):
self.__doc__ = getattr(func, '__doc__')
self.func = func

def __get__(self, obj, objtype=None):
if obj is None:
return self
value = self.func(obj)
setattr(obj, self.func.__name__, value)
value = obj.__dict__[self.func.__name__] = self.func(obj)
return value

def __repr__(self):
Expand Down

0 comments on commit 16e082f

Please sign in to comment.