Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/micheles/decorator
/ functions
Functions
124 in github.com/micheles/decorator
⨍
Functions
124
◇
Types & classes
34
↳
Endpoints
9
↓ 9 callers
Function
g
(obj)
src/tests/documentation.py:1823
↓ 5 callers
Function
check
Make sure one passes the expected number of arguments
src/decorator.py:360
↓ 5 callers
Method
create
Create a function from the strings name, signature and body. evaldict is the evaluation dictionary. If addsource is true an a
src/decorator.py:197
↓ 4 callers
Function
assertRaises
This works in Python 2.6 too
src/tests/test.py:22
↓ 4 callers
Function
getfullargspec
A quick and dirty replacement for getfullargspec for Python 2.X
src/decorator.py:55
↓ 3 callers
Function
decorate
decorate(func, caller) decorates a function using a caller. If the caller is a generator function, the resulting function will be a gener
src/decorator.py:224
↓ 3 callers
Function
dispatch_on
Factory of decorators turning a function into a generic function dispatching on the given arguments.
src/decorator.py:352
↓ 2 callers
Function
ancestors
Get a list of virtual MROs, one for each type
src/decorator.py:388
↓ 2 callers
Function
iscoroutinefunction
(f)
src/decorator.py:66
↓ 1 callers
Method
__init__
(self, func=None, name=None, signature=None, defaults=None, doc=None, module=None, funcdict=N
src/decorator.py:93
↓ 1 callers
Function
append
Append ``a`` to the list of the virtual ancestors, unless it is already included.
src/decorator.py:334
↓ 1 callers
Function
before_after
(before, after)
src/tests/documentation.py:1700
↓ 1 callers
Function
dec
(f)
src/decorator.py:413
↓ 1 callers
Function
decorator
decorator(caller) converts a caller function into a decorator
src/decorator.py:258
↓ 1 callers
Function
decorator_apply
Decorate a function by preserving the signature even if dec is not a signature-preserving decorator.
src/tests/documentation.py:1433
↓ 1 callers
Function
gen123
()
src/tests/test.py:61
↓ 1 callers
Function
isgeneratorfunction
(caller)
src/decorator.py:72
↓ 1 callers
Method
make
Make a new function from a given template and update the signature
src/decorator.py:162
↓ 1 callers
Method
update
Update the signature of func with the data in self
src/decorator.py:145
↓ 1 callers
Function
vancestors
Get a list of sets of virtual ancestors for the given types
src/decorator.py:376
Method
_
(obj)
src/tests/test.py:249
Method
__call__
Context manager decorator
src/decorator.py:304
Method
__call__
(self, *args, **kwd)
src/tests/documentation.py:1605
Function
__init__
(self, g, *a, **k)
src/decorator.py:314
Method
__init__
(self, func, *args, **kw)
src/tests/documentation.py:1458
Method
__init__
(self, func)
src/tests/documentation.py:1600
Method
__init__
(self, **config)
src/tests/documentation.py:1726
Method
__len__
(self)
src/tests/test.py:378
Method
__len__
(self)
src/tests/test.py:407
Method
__len__
(self)
src/tests/test.py:458
Method
__len__
(self)
src/tests/test.py:466
Method
__len__
(self)
src/tests/documentation.py:1785
Method
__len__
(self)
src/tests/documentation.py:1792
Method
__len__
(self)
src/tests/documentation.py:1845
Function
_dispatch
(dispatch_args, *args, **kw)
src/decorator.py:429
Method
_g
(obj)
src/tests/test.py:257
Function
_memoize
(func, *args, **kw)
src/tests/documentation.py:1507
Function
_trace
(f, *args, **kw)
src/tests/documentation.py:1443
Function
a_test_for_pylons
In version 3.1.0 decorator(caller) returned a nameless partial object, thus breaking Pylons. That must not happen again. >>> decorator(_
src/tests/documentation.py:1642
Method
add
(func, const=1, *args, **kwargs)
src/tests/test.py:155
Function
blocking
(f, msg='blocking', *args, **kw)
src/tests/documentation.py:1529
Method
catch_config_error
(method, app, *args, **kwargs)
src/tests/test.py:148
Function
contextmanager
(func)
src/decorator.py:327
Method
d1
(f, *args, **kwargs)
src/tests/test.py:108
Method
d2
(f, *args, **kwargs)
src/tests/test.py:112
Method
delete
Only the admin can delete objects
src/tests/documentation.py:1589
Function
dispatch_info
An utility to introspect the dispatch algorithm
src/decorator.py:419
Function
example
()
src/tests/documentation.py:1482
Method
example
(*args, **kw)
src/tests/test.py:135
Method
f
(x)
src/tests/test.py:158
Function
f1
Simulate some long computation
src/tests/documentation.py:1501
Method
f1
(x, y, z)
src/tests/test.py:116
Method
f2
(x, y, z)
src/tests/test.py:120
Function
fact
(n)
src/tests/documentation.py:1636
Function
factorial
The good old factorial
src/tests/documentation.py:1629
Method
func
(**kw)
src/tests/test.py:139
Method
func_wrapper
()
src/tests/documentation.py:1465
Method
g
(obj)
src/tests/test.py:171
Method
g_A
(a)
src/tests/test.py:200
Method
g_B
(b)
src/tests/test.py:204
Function
g_container
(arg)
src/tests/documentation.py:1857
Method
g_int
(i)
src/tests/test.py:175
Function
g_iterable
(object)
src/tests/documentation.py:1831
Function
g_s
(arg)
src/tests/documentation.py:1853
Function
g_sized
(object)
src/tests/documentation.py:1827
Function
gen_func_dec
Decorator turning a function into a generic function
src/decorator.py:366
Function
get_init
(cls)
src/decorator.py:48
Function
get_length
(obj)
src/tests/documentation.py:1797
Function
get_length_set
(obj)
src/tests/documentation.py:1807
Function
get_length_sized
(obj)
src/tests/documentation.py:1802
Method
h
(obj)
src/tests/test.py:418
Method
h_container
(arg)
src/tests/test.py:426
Method
h_sized
(arg)
src/tests/test.py:422
Function
hello
>>> ba.__class__.__name__ 'ContextManager' >>> hello('michele') BEFORE hello michele AFTER
src/tests/documentation.py:1710
Method
i
(obj)
src/tests/test.py:440
Method
i_mapping
(arg)
src/tests/test.py:444
Method
i_sequence
(arg)
src/tests/test.py:448
Function
identity_dec
(func)
src/tests/documentation.py:1475
Method
insert
Only power users can insert objects
src/tests/documentation.py:1585
Function
memoize
(*args, **kw)
src/tests/documentation.py:1489
Function
memoize_uw
(func)
src/tests/documentation.py:1486
Function
operation1
>>> operation1() operation1 is slow
src/tests/documentation.py:1878
Function
operation2
>>> operation2() operation2 is slow
src/tests/documentation.py:1887
Function
register
Decorator to register an implementation for the given types
src/decorator.py:407
Function
restricted
Restrict access to a given class of users
src/tests/documentation.py:1568
Method
result
(self)
src/tests/documentation.py:1470
Function
set_result
()
src/tests/documentation.py:1531
Function
singledispatch_example1
()
src/tests/documentation.py:1819
Function
singledispatch_example2
()
src/tests/documentation.py:1837
Method
square
(func, *args, **kw)
src/tests/test.py:70
Function
tail_recursive
(func)
src/tests/documentation.py:1624
Method
test
(self)
src/tests/test.py:79
Method
test_add1
(self)
src/tests/test.py:152
Method
test_c_classes
(self)
src/tests/test.py:243
Method
test_decorator_factory
(self)
src/tests/test.py:145
Method
test_gen123
(self)
src/tests/test.py:68
Function
test_kwonly_no_args
# this was broken with decorator 3.3.3 >>> @trace ... def f(**kw): pass ... >>> f() calling f with args (), {}
src/tests/documentation.py:1679
Function
test_kwonly_star_notation
>>> @trace ... def f(*, a=1, **kw): pass ... >>> import inspect >>> inspect.getfullargspec(f) FullArg
src/tests/documentation.py:1688
Function
test_kwonlyargs
>>> @trace ... def func(a, b, *args, y=2, z=3, **kwargs): ... return y, z ... >>> func('a', 'b', 'c', 'd'
src/tests/documentation.py:1668
Function
test_kwonlydefaults
>>> @trace ... def f(arg, defarg=1, *args, kwonly=2): pass ... >>> f.__kwdefaults__ {'kwonly': 2}
src/tests/documentation.py:1659
next →
1–100 of 124, ranked by callers