Skip to content

is_snapshot(s)

Return whether s is a snapshot wrapper.

This function lets extension authors recognize snapshot objects. It recognizes values returned by snapshot(), snapshot_arg(), external(), and external_file().

When inline-snapshot is disabled, snapshot functions return ordinary values instead of wrappers, so those values return False. Comparison values wrapped with Is() or outsource() return False.

Parameters:

Name Type Description Default
s object

The object to check.

required

Returns:

Type Description
bool

True if the object is a snapshot wrapper, otherwise False.