Skip to content

Commit

Permalink
add __self__ to maps
Browse files Browse the repository at this point in the history
  • Loading branch information
mmckerns committed Sep 8, 2022
1 parent 9a71430 commit 5fb54b0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pathos/maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,17 @@ def __call__(self, func, *args, **kwds):
if self._clear: self.clear()
return result #NOTE: ValueError on non-running pool

# function interface
def __cls__(self):
return self
def __meth__(self):
return self.__call__.__func__
def __attr__(self):
return self.__call__.__get__
__self__ = property(__cls__)
__func__ = property(__meth__)
__get__ = property(__attr__)

def close(self):
"close the map to any new jobs"
try:
Expand Down

0 comments on commit 5fb54b0

Please sign in to comment.