File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 2
2
Utilities for typed interfaces.
3
3
"""
4
4
from inspect import Parameter
5
- from itertools import dropwhile , starmap , takewhile , zip_longest
6
- from operator import contains
5
+ from itertools import starmap , takewhile , zip_longest
7
6
8
7
from .functional import complement , dzip , valfilter
9
8
@@ -12,12 +11,19 @@ def compatible(impl_sig, iface_sig):
12
11
"""
13
12
Check whether ``impl_sig`` is compatible with ``iface_sig``.
14
13
14
+ Parameters
15
+ ----------
16
+ impl_sig : inspect.Signature
17
+ The signature of the implementation function.
18
+ iface_sig : inspect.Signature
19
+ The signature of the interface function.
20
+
15
21
In general, an implementation is compatible with an interface if any valid
16
22
way of passing parameters to the interface method is also valid for the
17
23
implementation.
18
24
19
- The following differences are allowed between an implementation and its
20
- interface:
25
+ Consequently, the following differences are allowed between the signature
26
+ of an implementation methodand the signature of its interface definition :
21
27
22
28
1. An implementation may add new arguments to an interface iff:
23
29
a. All new arguments have default values.
You can’t perform that action at this time.
0 commit comments