News for hackers. Stuff that matters.
Re:New IPython release drops Python 2.7 support by jacquesm on Thursday April 20, 2017 @05:59PM (#14161291)
There are some easy to avoid pathological cases such as concatenating numpy arrays in a loop.

Take this gem from a well known course:

   np.concatenate([x.next() for i in range(x.nb)])
That looks pretty innocent but it can eat up your memory in an eyeblink if the input is large enough. That's the sort of pitfall that a lot of python code suffers from because the abstractions are just nice enough to make you believe this will work without penalty and without knowing how it is implemented under the hood you're suddenly out a few gigs of ram.
Re:New IPython release drops Python 2.7 support by ofek on Thursday April 20, 2017 @06:36PM (#14161514)
If np.concatenate accepts any iterable, removing the brackets is what you want to do there.
Re:New IPython release drops Python 2.7 support by jzwinck on Thursday April 20, 2017 @09:36PM (#14162455)
That won't help. Concatenate needs to know the total length up front. It will evaluate all the input items at once.