985
Views
15
Helpful
2
Replies
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2021 11:48 AM
Is there a way to check if an empty list has been set using the python API?
Solved! Go to Solution.
Labels:
- Labels:
-
Developer
1 Accepted Solution
Accepted Solutions
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2021 11:49 AM
It can be done using the exists() method. Will return "True" if has been set, otherwise the result will be "False". (Credits to Viktor Leijon)
2 Replies 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2021 11:49 AM
It can be done using the exists() method. Will return "True" if has been set, otherwise the result will be "False". (Credits to Viktor Leijon)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2021 01:50 AM
The empty leaf can also be passed to the function bool(), so bool(root.my_empty_leaf) will return its truth.
Python will call the bool() function whenever it sees an object that supports it inside an if statement, so you can also just use the leaf directly in an if test
If root.my_empty_leaf :
Do something
Python will call the bool() function whenever it sees an object that supports it inside an if statement, so you can also just use the leaf directly in an if test
If root.my_empty_leaf :
Do something
