File .deepsource.toml
not found in the default branch of the repository root. Please refer to the docs.
None
provided as default PTC-W0039None
as default value is redundant1450 """
1451
1452 def to_representation(self, value):
1453 serializer_cls = GFK_MODEL_SERIALIZER_MAPPING.get(type(value), None)1454 return (
1455 serializer_cls(value, context=self.context).data
1456 if serializer_cls
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")