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

Redis.select() requires host and port #21

Closed
mjrusso opened this issue Mar 26, 2010 · 3 comments
Closed

Redis.select() requires host and port #21

mjrusso opened this issue Mar 26, 2010 · 3 comments

Comments

@mjrusso
Copy link

mjrusso commented Mar 26, 2010

From the documentation for the select method of Redis:

Switch to a different database on the current host/port

However, host and port are required parameters:

def select(self, host, port, db, password=None, socket_timeout=None):

Can we make host and port optional, with db the only required parameter?

@andymccurdy
Copy link
Contributor

The additional arguments were intentionally added to make the user realize that they're switching the underlying TCP connection whenever they switch the database.

I suppose the current host/port could be used if changing to a different database and those arguments weren't provided.

@mjrusso
Copy link
Author

mjrusso commented Mar 26, 2010

I suppose the current host/port could be used if changing to a different database and those arguments weren't provided.

That's what I would have expected. However, as a user, it isn't a big deal to imitate that behavior with the existing implementation.

In any event, I would recommend either changing the documentation or the method signature/ semantics so that the two are in sync.

@andymccurdy
Copy link
Contributor

Ok, this has been fixed and commited in c148ede

dbravender pushed a commit to dbravender/redis-py that referenced this issue May 6, 2014
… If host and port aren't specified, the host/port options on the existing connection are used.

* added HINCRBY support
This issue was closed.
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