PKZ,dHÔã.§  $backports/functools_partialmethod.pyfrom __future__ import absolute_import from functools import partial class partialmethod(object): """Method descriptor with partial application of the given arguments and keywords. Supports wrapping existing descriptors and handles non-descriptor callables as instance methods. """ def __init__(self, func, *args, **keywords): if not callable(func) and not hasattr(func, "__get__"): raise TypeError("{!r} is not callable or a descriptor" .format(func)) # func could be a descriptor like classmethod which isn't callable, # so we can't inherit from partial (it verifies func is callable) if isinstance(func, partialmethod): # flattening is mandatory in order to place cls/self before all # other arguments # it's also more efficient since only one function will be called self.func = func.func self.args = func.args + args self.keywords = func.keywords.copy() self.keywords.update(keywords) else: self.func = func self.args = args self.keywords = keywords def __repr__(self): args = ", ".join(map(repr, self.args)) keywords = ", ".join("{}={!r}".format(k, v) for k, v in self.keywords.items()) format_string = "{module}.{cls}({func}, {args}, {keywords})" return format_string.format(module=self.__class__.__module__, cls=self.__class__.__name__, func=self.func, args=args, keywords=keywords) def _make_unbound_method(self): def _method(*args, **keywords): call_keywords = self.keywords.copy() call_keywords.update(keywords) cls_or_self, rest = args[0], args[1:] call_args = (cls_or_self,) + self.args + tuple(rest) return self.func(*call_args, **call_keywords) _method.__isabstractmethod__ = self.__isabstractmethod__ _method._partialmethod = self return _method def __get__(self, obj, cls): get = getattr(self.func, "__get__", None) result = None if get is not None: new_func = get(obj, cls) if hasattr(new_func, '__self__') and new_func.__self__ is None and hasattr(new_func, '__func__'): new_func = new_func.__func__ if new_func is not self.func: # Assume __get__ returning something new indicates the # creation of an appropriate callable result = partial(new_func, *self.args, **self.keywords) try: result.__self__ = new_func.__self__ result.__isabstractmethod__ = self.func.__isabstractmethod__ except AttributeError: pass if result is None: # If the underlying descriptor didn't do anything, treat this # like an instance method result = self._make_unbound_method().__get__(obj, cls) return result @property def __isabstractmethod__(self): return getattr(self.func, "__isabstractmethod__", False) PK#/dHÎ6ÐdLLbackports/__init__.pyfrom pkgutil import extend_path __path__ = extend_path(__path__, __name__) PKt2dH4øwwCbackports.functools_partialmethod-3.5.1.0.dist-info/DESCRIPTION.rstbackports.functools_partialmethod ======================= Backport of `functools.partialmethod` from Python 3.5.1. PKt2dH‘ C]œœAbackports.functools_partialmethod-3.5.1.0.dist-info/metadata.json{"classifiers": ["Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Topic :: Software Development :: Libraries :: Python Modules", "License :: OSI Approved :: Python Software Foundation License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3"], "extensions": {"python.details": {"contacts": [{"email": "pythonbackports@users.noreply.github.com", "name": "Python Backports", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}, "project_urls": {"Home": "https://github.com/PythonBackports/backports.functools_partialmethod"}}}, "generator": "bdist_wheel (0.26.0)", "keywords": ["python", "functools", "partialmethod", "backport"], "license": "Python Software Foundation License", "metadata_version": "2.0", "name": "backports.functools-partialmethod", "summary": "Backport of functools.partialmethod from Python 3.5.1.", "version": "3.5.1.0"}PKt2dHvÌ Abackports.functools_partialmethod-3.5.1.0.dist-info/top_level.txtbackports PKt2dHìndªnn9backports.functools_partialmethod-3.5.1.0.dist-info/WHEELWheel-Version: 1.0 Generator: bdist_wheel (0.26.0) Root-Is-Purelib: true Tag: py2-none-any Tag: py3-none-any PKt2dH'FXØnn<backports.functools_partialmethod-3.5.1.0.dist-info/METADATAMetadata-Version: 2.0 Name: backports.functools-partialmethod Version: 3.5.1.0 Summary: Backport of functools.partialmethod from Python 3.5.1. Home-page: https://github.com/PythonBackports/backports.functools_partialmethod Author: Python Backports Author-email: pythonbackports@users.noreply.github.com License: Python Software Foundation License Keywords: python functools partialmethod backport Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: License :: OSI Approved :: Python Software Foundation License Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 3 backports.functools_partialmethod ======================= Backport of `functools.partialmethod` from Python 3.5.1. PKt2dHRŸM??:backports.functools_partialmethod-3.5.1.0.dist-info/RECORDbackports/__init__.py,sha256=sBeH8xJoFFhkux9Mocpajg2CJ0qqIXA1tSZS5AOmDXo,76 backports/functools_partialmethod.py,sha256=Sc8w_JUBbnsOTDJEQtsC2QWkEwo68lYmi14YDU2n2Fs,3352 backports.functools_partialmethod-3.5.1.0.dist-info/DESCRIPTION.rst,sha256=r08HZkntzssNd-HslEBQ1kFNqVj3cXCP9QpKx7xZlbs,119 backports.functools_partialmethod-3.5.1.0.dist-info/METADATA,sha256=WcsA698jvNOayPD4J5I11N2TZfGefSQ5V7Bl7gtQ2IY,878 backports.functools_partialmethod-3.5.1.0.dist-info/RECORD,, backports.functools_partialmethod-3.5.1.0.dist-info/WHEEL,sha256=GrqQvamwgBV4nLoJe0vhYRSWzWsx7xjlt74FT0SWYfE,110 backports.functools_partialmethod-3.5.1.0.dist-info/metadata.json,sha256=PYESK5KoBrCos0sC2YWWxjZHK49aZJf0A_x5reE_gTs,924 backports.functools_partialmethod-3.5.1.0.dist-info/top_level.txt,sha256=cGjaLMOoBR1FK0ApojtzWVmViTtJ7JGIK_HwXiEsvtU,10 PKZ,dHÔã.§  $backports/functools_partialmethod.pyPK#/dHÎ6ÐdLLZ backports/__init__.pyPKt2dH4øwwCÙ backports.functools_partialmethod-3.5.1.0.dist-info/DESCRIPTION.rstPKt2dH‘ C]œœA±backports.functools_partialmethod-3.5.1.0.dist-info/metadata.jsonPKt2dHvÌ A¬backports.functools_partialmethod-3.5.1.0.dist-info/top_level.txtPKt2dHìndªnn9backports.functools_partialmethod-3.5.1.0.dist-info/WHEELPKt2dH'FXØnn<Úbackports.functools_partialmethod-3.5.1.0.dist-info/METADATAPKt2dHRŸM??:¢backports.functools_partialmethod-3.5.1.0.dist-info/RECORDPK9