4 ms·
What I don't get is it they break the language anyway, why they didn't fix classes. Most of python is pretty beautiful, but classes are so ugly, even basics lik
by ant6n 5y ago
What I don't get is it they break the language anyway, why they didn't fix classes. Most of python is pretty beautiful, but classes are so ugly, even basics like what is the Syntax for instance vs static cars, self/this, setting up constructors, calling inherited constructors. Like come on, how is it that they are uglier than Java in this regard.
- mattgreenrocks 5y agosuper() is a little cleaner to call now at least. The print() change drives me nuts: many scripts use the old form, and Python forces you to change it despite recognizing the old functionality. They could've simply allowed print expr to work as is and accepted it as a wart. The async stuff feels a bit like a bridge too far for me WRT the language. Simplicity would be standardizing on a function color (as it were). I don't envy their position of preserving backwards compat while evolving the language.
- dragonwriter 5y ago> They could've simply allowed print expr to work as is and accepted it as a wart. Old print isn't an expr at all, that was a major point of the change.
- olliej 5y agoI think the person you're replying to was saying that there was no reason to remove the statement form. The only thing that removing the statement form of print did was break existing code. You could easily allow print to act as a function by removing it as a reserved word in expression contexts. They made print a function out of a misplaced sense of language "purity", where they made a random ideal and broke code to support it. Let's compare to JS: 20 years of new features and old code still works. Keywords were added, and old code still works. Even code that uses those keywords still works. It took more effort from the language implementers, but that's as it should be: it took a bit more effort for a few teams (who make the engines), instead of a large amount of effort for tens of thousands of groups.
- loeg 5y agoThey made substantial changes to classes in Python3.
- franga2000 5y agoI really don't know what you're talking about. I've written a lot of object-oriented code in Python and Java and there isn't a single thing I like better in Java (that doesn't come from the typing system). I don't know about 3.0, but it's been great for years. Take a look at some Django code.