@@ -31,11 +31,13 @@ decorator is used (see next section).
31
31
32
32
Some of the most important things are:
33
33
34
- ### ``name ``
34
+ ``name ``
35
+ ^^^^^^^^
35
36
36
37
The name of the backend, must match the name of the entry-point.
37
38
38
- ### ``primary_types `` and ``secondary_types ``
39
+ ``primary_types `` and ``secondary_types ``
40
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
39
41
40
42
Primary and secondary types are defined by a sequence of strings
41
43
and stored as ``primary_types `` and ``secondary_types `` attributes in
@@ -61,7 +63,8 @@ If you use an abstract base class, note that you must take a lot of care:
61
63
classes correctly (but we order them last if a primary type, which is typically right).
62
64
- ``spatch `` will not guarantee correct behavior if an ABC is mutated at runtime.
63
65
64
- ### ``requires_opt_in ``
66
+ ``requires_opt_in ``
67
+ ^^^^^^^^^^^^^^^^^^^
65
68
66
69
A boolean indicating whether your backend should be active by default.
67
70
Typically, set this to ``True `` for a type dispatching backend and ``False `` otherwise.
@@ -86,7 +89,8 @@ set this to ``True`` if it's behavior matches the library behavior closely.
86
89
or only allow specific ones, and then everyone loses...
87
90
88
91
89
- ### functions
92
+ functions
93
+ ^^^^^^^^^
90
94
91
95
A mapping of library functions to your implementations. All fields use
92
96
the ``__module__:__qualname__ `` identifiers to avoid immediate import.
@@ -103,7 +107,8 @@ The following fields are supported for each function:
103
107
104
108
``spatch `` provides tooling to help create this mapping.
105
109
106
- ### Manual backend prioritization
110
+ Manual backend prioritization
111
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
107
112
108
113
``spatch `` tries to order backends based on the types,
109
114
but this cannot get the order right always.
@@ -114,7 +119,8 @@ for example ``higher_priority_than = ["default"]`` or
114
119
It is your responsibility to ensure that these prioritizations make sense and
115
120
are acceptable to other backends.
116
121
117
- ### More?
122
+ More?
123
+ ^^^^^
118
124
119
125
.. note :: Missing information?
120
126
We are probably missing important information currently. For example,
0 commit comments