None
provided as default PTC-W0039None
as default value is redundant132 result = {
133 "title": fchk["title"],
134 # if "Total Energy" is not present in FCHk, None is returned.
135 "energy": fchk.get("Total Energy", None),136 "lot": fchk["lot"].lower(),
137 "obasis_name": fchk["obasis_name"].lower(),
138 "atcoords": fchk["Current cartesian coordinates"].reshape(-1, 3),
None
as default value is redundant318 "full_virial_ratio",
319 "mo_spin",
320 ]
321 extra = {label: data.get(label, None) for label in extra_labels}322 extra["permutations"] = permutation
323
324 return {
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")