vj4
vj4 copied to clipboard
Let domain.get_user return empty dict ({}) instead of None when not found
Let domain.get_user
return empty dict ({}
) instead of None
when not found.
This will make some codes simpler
Why would it make code simpler?
In our projects, we would do that.
In general, processing data with the same return type is easier, you wouldn't like the idea that some method sometimes returns a certain type and on the other times another. Likewise, unify data types by making None
to {}
is a lot easier for programming and a bit more understandable.