In Python, empty containers such as lists,tuples,sets,dicts,variables etc are seen as False . One could simply treat the list as a predicate (returning a ... ... <看更多>
Search
Search
In Python, empty containers such as lists,tuples,sets,dicts,variables etc are seen as False . One could simply treat the list as a predicate (returning a ... ... <看更多>
... <看更多>
使用not operator 運算子 · #!/usr/bin/python3 · # -*- coding: utf-8 -*- · # or mylist = list() · if · 'mylist is empty' ... ... <看更多>
In this case, the Python YAML parser returns None, which I think Salt should be able to interpret the same way as an empty array. ... <看更多>
I know I could just write if not x: to check if the list is empty but I believe an empty iterable should raise an Exception when you try to iterate over it as ... ... <看更多>