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

to fix condition error that used in log_response #972

Merged
merged 1 commit into from
Oct 19, 2017

Conversation

lanfon72
Copy link
Contributor

request class is derived from dict, so it will never be True.

`request` class is derived from `dict`, so it will never be `True`.
@r0fls
Copy link
Contributor

r0fls commented Oct 14, 2017

request class is derived from dict, so it will never be True.

Well, that's false:

>>> nothing, something = {}, {'foo': 'bar'}
>>> if nothing:
...    print("you won't see me")
... 
>>> if something:
...    print("hello world")
... 
hello world

@lanfon72
Copy link
Contributor Author

lanfon72 commented Oct 14, 2017

I meant something like this:

from sanic.request import Request

r = Request(b"http://localhost/", 2,3,4, 5)
True if r else False
False if r else True
r, r.items(), r.keys(), r.values(), len(r), bool(r)

image

@seemethere seemethere added this to the 0.6.1 milestone Oct 19, 2017
Copy link
Member

@seemethere seemethere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@seemethere seemethere merged commit 727d6a1 into sanic-org:master Oct 19, 2017
@seemethere seemethere modified the milestones: 0.6.1, 0.7.0 Nov 13, 2017
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

Successfully merging this pull request may close these issues.

None yet

3 participants