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

instantiate with just the hostname #4

Open
JunAishima opened this issue Feb 15, 2024 · 1 comment
Open

instantiate with just the hostname #4

JunAishima opened this issue Feb 15, 2024 · 1 comment

Comments

@JunAishima
Copy link
Contributor

the user should not need to create a redis client connected to the desired host. this would simplify the instantiation.

d = RedisJSONDict("hostname", prefix="mymetadata")

@danielballan
Copy link
Contributor

A pattern I learned from @dutc that I like:

  • The __init__ should take the direct requirements (in this case, a Redis client instance).
  • One or more classmethod constructors may be added as convenience wrappers that handle various modalities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants