News for hackers. Stuff that matters.
Re:Why Python Runs Slow, Part 1: Data Structures by gopalv on Thursday February 13, 2014 @01:56PM (#7233355)
Python actually comes static shapes for objects with __slots__

class vertex(object):

   __slots__ = ["x", "y", "z"]
I use __slots__ in most code after the first refactor for a very important reason - I'm a hyper-caffeinated code monkey.

I wasted an entire day because I set self.peices in one place and self.pieces in another & couldn't figure out the bug, until I used the "grep method".

Re:Why Python Runs Slow, Part 1: Data Structures by munificent on Thursday February 13, 2014 @03:35PM (#7234105)
Right, but the problem here is you have to opt in to that. The most terse, simple way to express something is also the slowest.

Most classes have static shapes, so for the few types that are more dynamic, I think it makes sense for users to have to opt out.

Re:Why Python Runs Slow, Part 1: Data Structures by andreasvc on Thursday February 13, 2014 @04:49PM (#7234639)
pylint would have told you that as well.
Re:Why Python Runs Slow, Part 1: Data Structures by sheng on Thursday February 13, 2014 @03:16PM (#7233968)
try pycharm, it highlights occurrences of self.pieces with different colors where you are reading from and writing to it. It even makes it visible on the scrollbar.