qspec logo qspec logo

A physics toolbox for laser spectroscopy.

Static Badge Static Badge Static Badge

Static Badge Static Badge

© 2026 Patrick Müller. All rights reserved.

qspec. check_iterable  (  arg ,  dtype=str  )[source]

Cast an argument or the elements of an argument of type dtype to a list.

Parameters:
argobject

The argument that is checked.

dtypetype

The type that has to be matched by the elements of arg or arg itself.

Returns:
arg_listlist

arg as a list if it is a list, tuple or set of values of type dtype, a list of the single element arg if it is of type dtype and else an empty list.