is
when comparing type
of two objects 84 url=f"{self.url}open/crons",
85 headers={"Authorization": f"Bearer {self.token}"},
86 ).json()["data"]
87 if type(cron_data) == dict and "data" in cron_data.keys(): 88 cron_data = cron_data["data"]
89 self.cron = list(
90 filter(
It is recommended to use identity test
( is
) instead of equality test ( ==
) when you need to compare types of two objects.
if type(x) == str:
print(x)
if type(x) is str:
print(x)
# Alternatively,
if isinstance(x, str):
print(x)