diff options
author | da-woods <dw-git@d-woods.co.uk> | 2020-04-02 20:17:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-02 21:17:52 +0200 |
commit | 2ca3f569254ddee7d1561d102ccca0c9d3250c91 (patch) | |
tree | 334084ab545ad286739bb883a70a9a19c01eef4e /Demos | |
parent | 830bdfac310935ff0a4b68a640bd9fcc7624e73c (diff) | |
download | cython-2ca3f569254ddee7d1561d102ccca0c9d3250c91.tar.gz |
Relaxed some of the checks on calling fused functions (GH-3381)
Relaxed some of the checks of fused functions to be consistent with general CyFunctions.
```
# cython: binding=True
def f(arg):
pass
class C: # or cdef class...
f = f
def g(self, ...):
pass
C.f(something) or C().f() # doesn't enforce any checks on the type of arg -
# with a fused function it does.
C.g(something) # assumes that self is "C" (at least for a cdef class)
# but doesn't check it. A fused function enforces that it is C.
C.f() # fails with a fused function claiming too few arguments, even though
# default arguments may make it a valid call
```
Obviously removing checks does make things a little less safe, but it
is consistent with the more general function behaviour. (I'm doing
this as part of a broad plan to abuse fused functions to be a bit
cleverer about decorators, but I don't think the motivation hugely
matters for this change)
Diffstat (limited to 'Demos')
0 files changed, 0 insertions, 0 deletions