Removed "is not None"

https://stackoverflow.com/users/566644/lauritz-v-thaulow

freqtrade\configuration\configuration.py:461 reduced checks

freqtrade\persistence\trade_model.py:fee_updated - reduced code
This commit is contained in:
மனோஜ்குமார் பழனிச்சாமி
2022-05-18 03:27:18 +05:30
parent 7b9439f2e4
commit e7f15fb61f
48 changed files with 191 additions and 194 deletions

View File

@@ -210,8 +210,8 @@ class IResolver:
for obj in cls._get_valid_object(module_path, object_name=None,
enum_failed=enum_failed):
objects.append(
{'name': obj[0].__name__ if obj is not None else '',
'class': obj[0] if obj is not None else None,
{'name': obj[0].__name__ if obj else '',
'class': obj[0] if obj else None,
'location': entry,
})
return objects

View File

@@ -128,10 +128,10 @@ class StrategyResolver(IResolver):
elif hasattr(strategy, attribute):
val = getattr(strategy, attribute)
# None's cannot exist in the config, so do not copy them
if val is not None:
if val:
config[attribute] = val
# Explicitly check for None here as other "falsy" values are possible
elif default is not None:
elif default:
setattr(strategy, attribute, default)
config[attribute] = default