Commit c354dca
committed
Add __len__ and __bool__ methods
It's useful to know how many pending commands are on a Pipeline object;
this adds a __len__ method for that. A __bool__ method is added so
Pipeline instances will evaluate to True even if they have no pending
commands. (I added a __bool__ method to RedisObject also, since it has a
__len__ method.)1 parent 3f9693b commit c354dca
1 file changed
Lines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
151 | 163 | | |
152 | 164 | | |
153 | 165 | | |
| |||
749 | 761 | | |
750 | 762 | | |
751 | 763 | | |
752 | | - | |
| 764 | + | |
753 | 765 | | |
754 | 766 | | |
755 | 767 | | |
| |||
1324 | 1336 | | |
1325 | 1337 | | |
1326 | 1338 | | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
1327 | 1345 | | |
1328 | 1346 | | |
1329 | 1347 | | |
| |||
0 commit comments