3 ms·
It's just a coding convention in python. All in-place operations in python are supposed to return None, as a way of explicitly signaling that the operation was
by jofer 13y ago
It's just a coding convention in python.
All in-place operations in python are supposed to return None, as a way of explicitly signaling that the operation was done on the existing object. It's not always followed outside the standard library, but it's very rare to run across an exception.
It's counter-intuitive at first, especially in this case, but it is consistent.