temp_argv.append(arg)
logger.info("Updating %s from zookeeper async config change.", arg)
- if len(temp_argv) > 0:
+ if temp_argv:
old_argv = sys.argv
sys.argv = temp_argv
known, _ = ARGS.parse_known_args()
else:
saw_other_args = True
- if not loadfile or len(loadfile) == 0:
+ if not loadfile:
return
# Get contents from wherever.
# didn't recognize it, maybe someone else will. Or, if
# --config_rejects_unrecognized_arguments was passed, die
# if we have unknown arguments.
- if len(unknown) > 0:
+ if unknown:
if config["config_rejects_unrecognized_arguments"]:
raise Exception(
f"Encountered unrecognized config argument(s) {unknown} with --config_rejects_unrecognized_arguments enabled; halting."
# Check for savefile and populate it if requested.
savefile = config["config_savefile"]
- if savefile and len(savefile) > 0:
+ if savefile:
data = "\n".join(ORIG_ARGV[1:])
if savefile[:3] == "zk:":
self._write_config_to_zookeeper(savefile[3:], data)
return self
def __next__(self) -> Any:
- if len(self.on_deck) > 0:
+ if self.on_deck:
return self.on_deck.pop()
else:
item = self.source_iter.__next__()
`StopIteration` when read.
"""
- if len(self.on_deck) > 0:
+ if self.on_deck:
return self.on_deck[0]
try:
item = next(self.source_iter)
return self
def __next__(self) -> Any:
- if len(self.pushed_back) > 0:
+ if self.pushed_back:
return self.pushed_back.pop()
return self.source_iter.__next__()
(in_str, decimal_part) = in_str.split('.')
tmp = [iter(in_str[::-1])] * places
ret = separator_char.join("".join(x) for x in zip_longest(*tmp, fillvalue=""))[::-1]
- if len(decimal_part) > 0:
+ if decimal_part:
ret += '.'
ret += decimal_part
return ret