Skip to content

Commit

Permalink
minor style edits to string accessor
Browse files Browse the repository at this point in the history
  • Loading branch information
mrocklin committed May 15, 2015
1 parent b22f6f8 commit ad9d929
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dask/bag/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ def __init__(self, bag):
def __dir__(self):
return sorted(set(dir(type(self)) + dir(str)))

def strmap(self, func, *args, **kwargs):
def _strmap(self, func, *args, **kwargs):
return self._bag.map(lambda s: func(s, *args, **kwargs))

def __getattr__(self, key):
Expand All @@ -889,7 +889,7 @@ def __getattr__(self, key):
except AttributeError:
if key in dir(str):
func = getattr(str, key)
return robust_wraps(func)(partial(self.strmap, func))
return robust_wraps(func)(partial(self._strmap, func))
else:
raise

Expand All @@ -913,6 +913,7 @@ def match(self, pattern):


def robust_wraps(wrapper):
""" A weak version of wraps that only copies doc """
def _(wrapped):
wrapped.__doc__ = wrapper.__doc__
return wrapped
Expand Down

0 comments on commit ad9d929

Please sign in to comment.