

Django Redis Pipeline trick - Goopplesoft
http://www.pnegahdar.com/django-redis-pipeline-trick/

======
raverbashing
"if request.pipeline.command_stack != []"

No

That's the worse way to checking it's empty, even if pipeline was a python
list

And this pipeline is interesting, but in this case, it's useful for setting
values, not reading them.

~~~
Goopplesoft
Hey! I (author) agree this isn't a great way to check equality in python,
however after testing this is the way I'm sure it will work 100% of the time,
so I went with it. If not [] would be more pythonic though.

~~~
raverbashing
Checking the code: [https://github.com/andymccurdy/redis-
py/blob/master/redis/cl...](https://github.com/andymccurdy/redis-
py/blob/master/redis/client.py#L1638)

It implements __len__ so there's your answer

~~~
Goopplesoft
Thanks, ill update the code in a bit.

~~~
raverbashing
Great, sorry if I was too harsh in the original post

