vj4 icon indicating copy to clipboard operation
vj4 copied to clipboard

Let domain.get_user return empty dict ({}) instead of None when not found

Open twd2 opened this issue 5 years ago • 3 comments

Let domain.get_user return empty dict ({}) instead of None when not found.

twd2 avatar Apr 10 '19 01:04 twd2

This will make some codes simpler

moesoha avatar Apr 10 '19 01:04 moesoha

Why would it make code simpler?

breezewish avatar Apr 10 '19 02:04 breezewish

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.

ZsgsDesign avatar May 14 '19 07:05 ZsgsDesign