News for hackers. Stuff that matters.
Re:Never run ‘python’ in your downloads folder by opportune on Sunday August 23, 2020 @10:03PM (#24256953)
Self is a little beginner-unfriendly if they have exposure to other OO languages. In fact the OO model in Python, aside from inheritance/polymorphism, IMO provides a rather uncompelling story for why you should use it other than just naked data structures, because its implementation is too close to a dict, and it doesn't offer you good compile time/type checks (or if it does, it's not readily apparent how to take advantage of them) which will lead a beginner to lots of AttributeError
Re:Never run ‘python’ in your downloads folder by dralley on Tuesday August 25, 2020 @11:25PM (#24278792)
"self" was what made it finally click for me that methods are just functions that take a copy of the data structure they're operating on.

Java's "this" is just kind of implicit magic in comparison, and it didn't accomplish the same understanding.

Re:Never run ‘python’ in your downloads folder by pyuser583 on Tuesday September 01, 2020 @12:48AM (#24338656)
You should check out Go.
Re:Never run ‘python’ in your downloads folder by pyuser583 on Sunday August 23, 2020 @11:13PM (#24257248)
I saw a meme that was “what if everything was x” for each programming language. For Python it was “what I’d everything was a hash.”