None
provided as default PTC-W0039None
as default value is redundant 96 @classmethod
97 def build(cls, root_service):
98 plugin_up = cls.plugin_name.upper()
99 interface = settings.get('%s_RECEIVER_INTERFACE' % plugin_up, None)100 port = int(settings.get('%s_RECEIVER_PORT' % plugin_up, 0))
101 protocol = cls
102
It is unnecessary to provide None
as the default value when the key is not present in the dictionary as get
implicitly returns None
.
Not preferred:
value = some_dict.get("key", None)
Preferred:
value = some_dict.get("key")