Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

make session a parameter #360

Closed
wants to merge 1 commit into from
Closed

Conversation

dschien
Copy link

@dschien dschien commented Aug 11, 2016

I would like to reuse the session while using the client in my django app. For this purpose I have made the session a parameter.

@aviau
Copy link
Collaborator

aviau commented Sep 9, 2016

This will create a session for all future clients.

You must do something like

function(session=None):
    if session is None:
        session=session.Session()

This is a common mistake: http://docs.python-guide.org/en/latest/writing/gotchas/#mutable-default-arguments

Can you please update your PR?

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

Successfully merging this pull request may close these issues.

3 participants