types_doc.md

January 24, 2025 ยท View on GitHub

Skylib module containing functions checking types.

types.is_bool

load("@bazel_skylib//lib:types.bzl", "types")

types.is_bool(v)

Returns True if v is an instance of a bool.

PARAMETERS

NameDescriptionDefault Value
vThe value whose type should be checked.none

RETURNS

True if v is an instance of a bool, False otherwise.

types.is_depset

load("@bazel_skylib//lib:types.bzl", "types")

types.is_depset(v)

Returns True if v is an instance of a depset.

PARAMETERS

NameDescriptionDefault Value
vThe value whose type should be checked.none

RETURNS

True if v is an instance of a depset, False otherwise.

types.is_dict

load("@bazel_skylib//lib:types.bzl", "types")

types.is_dict(v)

Returns True if v is an instance of a dict.

PARAMETERS

NameDescriptionDefault Value
vThe value whose type should be checked.none

RETURNS

True if v is an instance of a dict, False otherwise.

types.is_function

load("@bazel_skylib//lib:types.bzl", "types")

types.is_function(v)

Returns True if v is an instance of a function.

PARAMETERS

NameDescriptionDefault Value
vThe value whose type should be checked.none

RETURNS

True if v is an instance of a function, False otherwise.

types.is_int

load("@bazel_skylib//lib:types.bzl", "types")

types.is_int(v)

Returns True if v is an instance of a signed integer.

PARAMETERS

NameDescriptionDefault Value
vThe value whose type should be checked.none

RETURNS

True if v is an instance of a signed integer, False otherwise.

types.is_list

load("@bazel_skylib//lib:types.bzl", "types")

types.is_list(v)

Returns True if v is an instance of a list.

PARAMETERS

NameDescriptionDefault Value
vThe value whose type should be checked.none

RETURNS

True if v is an instance of a list, False otherwise.

types.is_none

load("@bazel_skylib//lib:types.bzl", "types")

types.is_none(v)

Returns True if v has the type of None.

PARAMETERS

NameDescriptionDefault Value
vThe value whose type should be checked.none

RETURNS

True if v is None, False otherwise.

types.is_set

load("@bazel_skylib//lib:types.bzl", "types")

types.is_set(v)

Returns True if v is a set created by sets.make().

PARAMETERS

NameDescriptionDefault Value
vThe value whose type should be checked.none

RETURNS

True if v was created by sets.make(), False otherwise.

types.is_string

load("@bazel_skylib//lib:types.bzl", "types")

types.is_string(v)

Returns True if v is an instance of a string.

PARAMETERS

NameDescriptionDefault Value
vThe value whose type should be checked.none

RETURNS

True if v is an instance of a string, False otherwise.

types.is_tuple

load("@bazel_skylib//lib:types.bzl", "types")

types.is_tuple(v)

Returns True if v is an instance of a tuple.

PARAMETERS

NameDescriptionDefault Value
vThe value whose type should be checked.none

RETURNS

True if v is an instance of a tuple, False otherwise.