Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
twd2 opened this issue Apr 10, 2019 · 3 comments
Open
Assignees

Comments

@twd2
Copy link
Member

twd2 commented Apr 10, 2019

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

@twd2 twd2 changed the title Let domain.get_user return empty dict ({}) instead of None if not found Let domain.get_user return empty dict ({}) instead of None when not found Apr 10, 2019
@moesoha
Copy link
Member

moesoha commented Apr 10, 2019

This will make some codes simpler

@breezewish
Copy link
Member

Why would it make code simpler?

@ZsgsDesign
Copy link
Contributor

ZsgsDesign commented May 14, 2019

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.

@twd2 twd2 self-assigned this Aug 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants