-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
web.Application object have a boolean value of False #4102
Comments
Why do you think so? |
Because it seems to me that a boolean value of Also from experience, it seems to me that any random object from any random library has a boolean value of if subapp:
app.add_subapp('/foo', app) or app = this_user_supplied_app or this_backup_app will behave in a way that is unexpected for the random Python developer (which I am, I got bitten by the first one). |
|
Yes I could figure that out. I still find the behavior counter-intuitive compared to what all the rest of Python is usually doing, my arguments are in the previous comment. You are free to disagree, and considering your contributions to this project (which I thank you for) you are naturally the one with the final word, and I won't argue (especially since it's not a big problem and it's not preventing anyone to use |
Ok. I forgot that we had the same problem for exceptions. Would you want to make a pull request for A couple of trivial tests are required. |
Ok, I'll try to do that in the coming days. |
Fixed by #4124 |
Long story short
Not a huge issue but a bit unsettling: the boolean value of
web.Application()
isFalse
Expected behaviour
should print
true
Actual behaviour
Prints
false
Steps to reproduce
Create an app like in the above code
Your environment
OS:
Linux Ubuntu 19.04
python:
Python 3.7.3
aiohttp and deps:
The text was updated successfully, but these errors were encountered: