3 ms·
In C++ it's fairly common to be calling begin() and end() on containers, where in Python it's not common to call next(), you let the for loop handle it. It's re
by xymostech 13y ago
In C++ it's fairly common to be calling begin() and end() on containers, where in Python it's not common to call next(), you let the for loop handle it. It's reasonable to rename a function to something ugly when you're never going to be seeing it.
- ceol 13y agoThat's the best time, so that people don't think it's a function they should be calling without understanding exactly what they're doing.
- masklinn 13y ago> where in Python it's not common to call next() In fact it should never happen, that's what the `iter` and `next` builtins are for. The only use case for calling __next__ by hand is iffy as hell, it's overloading it while inheriting from an iterator.