All I care about is allowing a print statement in addition to the print function. There's no technical reason why both can't coexist in a perfectly usable manner.
pr --> print(" ")
# ^ cursor291–300 of 558 posts
All I care about is allowing a print statement in addition to the print function. There's no technical reason why both can't coexist in a perfectly usable manner.
pr --> print(" ")
# ^ cursorEarlier quoted context omitted.
But now there are two ways to do assignment. That's not very pythonic, is it?
Assignment can be confusing already. >>> locals()['a'] = 1 >>> a 1 If anything, the walrus operator allows for tightly-scoped assignment, which is good in my opinion.
x = [1, 2, 3, 4]
def foo():
x[0] += 3 # Okay
def bar():
x += [3] # UnboundLocalError
def qux():
x = [5, 6, 7, 8] # Binds a new `x`.Earlier quoted context omitted.
I don't think it's just >35-year-olds who find what's going on in Python against the natural order of things?
I'm 34 and I don't like this, so it's definitely not only those above 35. Jokes aside, I would say I'm a minimalist and this is where my resistance comes from. One of the things that I dislike the most in programming is feature creep. I prefer smaller languages. I like the idea of having a more minimal feature set that doesn't change very much. In a language with less features, you might have to write slightly more c…
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 that in Go or Python and compare the readability.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.
“I've come up with a set of rules that describe our reactions to technologies: 1. Anything that is in the world when you’re born is normal and ordinary and is just a natural part of the way the world works. 2. Anything that's invented between when you’re fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. 3. Anything invented after you're thirty-five is against the n…
My understanding of Python will probably never be quite as good as my understanding of C, but I can live with that.
I long for a language which has a basic featureset, and then "freezes", and no longer adds any more language features. You may continue working on the standard library, optimizing, etc. Just no new language features. In my opinion, someone should be able to learn all of a language in a few days, including every corner case and oddity, and then understand any code. If new language features get added over time, eventua…
Earlier quoted context omitted.
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
This is great! Thanks for your work. Can V be integrated into existing c++ projects? I work in audio and constantly working in c++ is tiring. I'd love to work in something like V and transpile down.
Earlier quoted context omitted.
It's not always a nanosecond, some string representations can take a while to create. In poorly coded Django models they could involve a trip to the database.
if logger.isEnabledFor(logging.DEBUG): logger.debug(f'{expensive_func()}')
Do parsers of previous pythons emit warnings: "this feature is not available in pythons 3.3 3.4 3.5 etc" ?
Generally, library authors won't be able to use it if they want to support many versions; same as with f-strings.
Earlier quoted context omitted.
I envisioned it like "if/else" or "for/else" or "while/else", where a "do" block must be followed by a "while" block. x = 0 do: x += 1 while: x
This completely contradicts the rest of Python grammar, and indeed many languages’ grammars. The consistent way would then be `while x < 10` but that too looks ridiculous. The issue is that you can’t have post-clause syntax in Python due to its infamous spacing-is-syntax idea.
Earlier quoted context omitted.
I see what you're saying, but I kinda like the gets ":=" operator.
But now there are two ways to do assignment. That's not very pythonic, is it?
Also, I can't bring myself to call it the walrus operator. Sorry, guys. I had a Pascal teacher ages ago who pronounced it "gets" and that has always stuck.