sanic-session
sanic-session copied to clipboard
Why does this piece of code work?
https://github.com/ahopkins/sanic-session/blob/551de4b503ab1a595b3b2b07cbe08806508a043e/sanic_session/base.py#L164-L169
Hello,
I was reading your code and stumbled upon the linked code lines.
There I don't understand why line 167 doesn't throw an error.
Because if if not req[self.session_name]
evaluates to True
how can there be a modified
field?
Best Simon
It checks the value of req[self.session_name]
's modified
field. learn python...
No reason to be toxic. I know Python very well.
I just don't make sense to me to access req[self.session_name].modified
when not req[self.session_name] == True
.