Currently, to test whether a sacc.Sacc object contains a tracer of a given name, it seems one must either:
use the method get_tracer and catch the resulting KeyError if there is no such tracer, or
directly access the tracers instance variable.
The existence of the get_tracer method, which does the key lookup for the caller, seems to be an indication that client code making direct access to the instance variables is not preferred.
Can we then have a has_tracer method to make the query simpler for client code, without having the client code access the instance variable tracers directly?
Currently, to test whether a
sacc.Sacc
object contains a tracer of a given name, it seems one must either:get_tracer
and catch the resultingKeyError
if there is no such tracer, ortracers
instance variable.The existence of the
get_tracer
method, which does the key lookup for the caller, seems to be an indication that client code making direct access to the instance variables is not preferred.Can we then have a
has_tracer
method to make the query simpler for client code, without having the client code access the instance variabletracers
directly?I will create a pull request for this feature.