matplotlib 3.5.1

NotesBackRef
select_matching_signature(funcs, *args, **kwargs)

funcs is a list of functions which should not raise any exception (other than :None:None:`TypeError` if the arguments passed do not match their signature).

select_matching_signature tries to call each of the functions in funcs with *args, **kwargs (in the order in which they are given). Calls that fail with a :None:None:`TypeError` are silently skipped. As soon as a call succeeds, select_matching_signature returns its return value. If no function accepts *args, **kwargs , then the :None:None:`TypeError` raised by the last failing call is re-raised.

Callers should normally make sure that any *args, **kwargs can only bind a single func (to avoid any ambiguity), although this is not checked by select_matching_signature .

Notes

select_matching_signature is intended to help implementing signature-overloaded functions. In general, such functions should be avoided, except for back-compatibility concerns. A typical use pattern is ::

Select and call the function that accepts *args, **kwargs .

Examples

See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

matplotlib._api.select_matching_signature

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /matplotlib/_api/__init__.py#228
type: <class 'function'>
Commit: