Skip to content

Commit 8afd7cb

Browse files
committed
remove unused util, closes pandas-dev#19676
1 parent b975455 commit 8afd7cb

File tree

1 file changed

+0
-46
lines changed

1 file changed

+0
-46
lines changed

pandas/util/_decorators.py

-46
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from pandas.compat import callable, signature, PY2
22
from pandas._libs.properties import cache_readonly # noqa
33
import inspect
4-
import types
54
import warnings
65
from textwrap import dedent, wrap
76
from functools import wraps, update_wrapper, WRAPPER_ASSIGNMENTS
@@ -339,48 +338,3 @@ def make_signature(func):
339338
if spec.keywords:
340339
args.append('**' + spec.keywords)
341340
return args, spec.args
342-
343-
344-
class docstring_wrapper(object):
345-
"""
346-
Decorator to wrap a function and provide
347-
a dynamically evaluated doc-string.
348-
349-
Parameters
350-
----------
351-
func : callable
352-
creator : callable
353-
return the doc-string
354-
default : str, optional
355-
return this doc-string on error
356-
"""
357-
_attrs = ['__module__', '__name__',
358-
'__qualname__', '__annotations__']
359-
360-
def __init__(self, func, creator, default=None):
361-
self.func = func
362-
self.creator = creator
363-
self.default = default
364-
update_wrapper(
365-
self, func, [attr for attr in self._attrs
366-
if hasattr(func, attr)])
367-
368-
def __get__(self, instance, cls=None):
369-
370-
# we are called with a class
371-
if instance is None:
372-
return self
373-
374-
# we want to return the actual passed instance
375-
return types.MethodType(self, instance)
376-
377-
def __call__(self, *args, **kwargs):
378-
return self.func(*args, **kwargs)
379-
380-
@property
381-
def __doc__(self):
382-
try:
383-
return self.creator()
384-
except Exception as exc:
385-
msg = self.default or str(exc)
386-
return msg

0 commit comments

Comments
 (0)