MCPcopy Create free account
hub / github.com/dask/dask / decorator

Function decorator

dask/dataframe/accessor.py:89–100  ·  view source on GitHub ↗
(accessor)

Source from the content-addressed store, hash-verified

87
88def _register_accessor(name, cls):
89 def decorator(accessor):
90 if hasattr(cls, name):
91 warnings.warn(
92 "registration of accessor {!r} under name {!r} for type "
93 "{!r} is overriding a preexisting attribute with the same "
94 "name.".format(accessor, name, cls),
95 UserWarning,
96 stacklevel=2,
97 )
98 setattr(cls, name, CachedAccessor(name, accessor))
99 cls._accessors.add(name)
100 return accessor
101
102 return decorator
103

Callers

nothing calls this directly

Calls 2

CachedAccessorClass · 0.85
addMethod · 0.45

Tested by

no test coverage detected