Python looks more and more foreign with each release. I'm not sure what happened after 3.3 but it seems like the whole philosophy of "pythonic", emphasizing simplicity, readability and "only one straightforward way to do it" is rapidly disappearing.
You can write very Python2.7 looking code with Python3. I don't think many syntax changes/deprecations have occurred (I know some have).
What's Coming in Python 3.8
531–540 of 558 posts
Re: What's Coming in Python 3.8
#532Earlier quoted context omitted.
Actually it doesn't violate any of the principles behind the language. It could have been there from day one, like tons of others things added later and now totally loved. I should know, I've worked with Python for 22 years...
Guido disagrees and rejected the idea multiple time in the last 2 decades. I think he worked on Python for a long time too :) This feature is kind of a symbol, the first real decision of the transition between the bdfl and the next era. I'm not worried about it, but yes, it was really against python core principles.
Re: What's Coming in Python 3.8
#533Despite controversy, walrus operator is going to be like f-strings. Before: "Why do we need another way to..." After: "Hey this is great". People are wtf-ing a bit about the positional-only parameters, but I view that as just a consistency change. It's a way to write in pure Python something that was previously only possible to say using the C api.
Also, it's times like these I'm really glad docker exists. Trying that out before docker would have been a way bigger drama
Re: What's Coming in Python 3.8
#534Earlier quoted context omitted.
What's stopping people from forking the language at python 2.7? Let the pythonistas add whatever feature they feel like while people who need stability use "Fortran python" or whatever.
> What's stopping people from forking the language at python 2.7? If you don't want to change/add something to the language, then why fork it?. You can just continue using it as it is!
Re: What's Coming in Python 3.8
#535Python looks more and more foreign with each release. I'm not sure what happened after 3.3 but it seems like the whole philosophy of "pythonic", emphasizing simplicity, readability and "only one straightforward way to do it" is rapidly disappearing.
I'm working on a language with a focus on simplicity and "only one way to do it": https://vlang.io The development has been going quite well: https://github.com/vlang/v/blob/master/CHANGELOG.md
If I wanted a language with "only one way to do it", i'd use Brainfuck. Which, btw, is very easy to learn, well documented, and the same source code runs on many, many platforms.
Re: What's Coming in Python 3.8
#536Specifically "There should be one -- and preferably only one --obvious way to do it."
If this was any other language, the addition would be welcome, but I feel that the walrus operator fundamentally disagrees with what python is about.
It's not about terseness and cleverness, it's about being clear, and having one way to do things (Unless you are Dutch).
Re: What's Coming in Python 3.8
#537Earlier quoted context omitted.
> In a language with less features, you might have to write slightly more code, but the code you write will be more readable to everyone else. I disagree with this, which is precisely why I prefer feature rich languages like Java or better yet Kotlin. It doesn't get much more readable than something like: users.asSequence() .filter { it.lastName.startsWith("S") } .sortedBy { it.lastName } .take(3) Now try writing tha…
A little off-topic but how does that work? Is 'it' a magic variable referring to the first argument? Never seen magic variables that blend into lambdas like that before... would've expected $1 or something like that.
users.asSequence()
.filter { user ->
user.lastName.startsWith("S")
}
.sortedBy { user ->
user.lastName
}
.take(3)Re: What's Coming in Python 3.8
#538Re: What's Coming in Python 3.8
#539Earlier quoted context omitted.
Nothing stops one from evaluating f-strings lazily. They could simply return a format string with parameters captured instead of interpolated string.
They could... but then they wouldn’t return the interpolated string, and they’d be just like using format, just saving the characters “.format” which ruins the exact thing people like about them.
Re: What's Coming in Python 3.8
#540Earlier quoted context omitted.
How would you subvert Greenspun in large codebases without Common Lisp? I once used Drools the rules engine which used a dynamic scripting language on Java objects. Python could have replaced that language, with much better tooling, errors etc.
Could you have written that system in a mix of Java and or another scripting language such as JRuby[0]? [0] http://wiki.c2.com/?AlternateHardAndSoftLayers