Live data from Hacker News

What's Coming in Python 3.8

lwn.net

351–360 of 558 posts

Re: What's Coming in Python 3.8

#351

Earlier quoted context omitted.

Well, maybe not for every language, but probably for a language where simplicity has been a major feature.

I started using Python seriously only three years ago after 30 years of other languages and I didn't find it very simple. Maybe the core of the language is simple but the standard library and many other important modules can be very complicated. Among similar languages Ruby and JavaScript are far simpler.

Javascript isn't simple any longer. And I'm not sure Ruby is that simple, not once you dig into the advanced features.

Re: What's Coming in Python 3.8

#352

Earlier quoted context omitted.

I like "as" instead. I didn't realize that was on the table. To me, it seems more Pythonic given the typical English-like Python syntax of "with open(path) as file", "for element in items if element not in things", etc.

"if m as re.match(p1, line)" is not very English-like.

`if re.match(p1, line) as m`, maybe?

Re: What's Coming in Python 3.8

#353
post #24

Earlier quoted context omitted.

“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…

I don't think it's just >35-year-olds who find what's going on in Python against the natural order of things?

theory : age itself with regards to computing has nothing to do with how old you act (with regards to computing), the time you spent doing a specific thing is what grows that 'characteristic'.

Anecdote : i'm fairly young, but i've been involved with python long enough and traveled to enough pycons to be a bit jaded with regards to change within the language.

I'm fairly certain it's only due to the additional cognitive load that's thrust upon me when I must learn a new nuance to a skill that I already considered myself proficient at.

in other words : i'm resistant to change because i'm lazy, and because it (the language, and the way I did things previously) works for me. Both reasons are selfish and invalid, to a degree.

Re: What's Coming in Python 3.8

#354
post #314
post #281

Earlier quoted context omitted.

I truly wish this would become a thing. It's really frustrating having to update my installed packages and my code for some stupid change the language designers thought is sooo worth it. Just stabilize the bloody thing so I can do some work. Updating code so it meshes with the "latest and greatest" is _not real work_.

Fixing the entirely broken string/bytes mess up in Python 2 was worth it by itself. For bonus points old style classes went away, and the language got a significant speed boost. And now it’s not going to die a slow death, choking on the past poor decisions it’s burdened with. Trivializing that by suggesting it was some offhand, unneeded solution to a problem that some dreamy “language designer” thought up is at best…

[deleted]

Re: What's Coming in Python 3.8

#355

Earlier quoted context omitted.

I like "as" instead. I didn't realize that was on the table. To me, it seems more Pythonic given the typical English-like Python syntax of "with open(path) as file", "for element in items if element not in things", etc.

"if m as re.match(p1, line)" is not very English-like.

Because the variable goes after the as. if re.match(p1, line) as m:

Re: What's Coming in Python 3.8

#356

Earlier quoted context omitted.

Python 2.7 is not far from that language.

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.

In my fantasy-py language, there is no "str", base types would be explicit. unicode() bytes(). "something" could have an implicit u"". Composite types could be explicit. If I want a set of int's, I can use mypy now to s1: t.Set[int] = set(), but that's just linting.

Re: What's Coming in Python 3.8

#357
post #8

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'm someone who loves the new features even though I don't think they're "pythonic" in the classical meaning of this term. That makes me think that being pythonic at it's most base level is actually about making it easier to reason about your code... and on that count I have found most of the new features have really helped.

Re: What's Coming in Python 3.8

#358
post #133

Earlier quoted context omitted.

> my freshest student in front of a code and see how they deal with it. That is fine if you want to optimize language for "fresh students". That is not representative how brain process stuff after getting even some experience.

It's not about experience vs inexperience... it's about code readability and being unsurprising. m = re.match(...) if m: ... do something ... is verbose, but quite readable. Given that it's the way things have been done since forever, it's also unsurprising. if m := re.match(...): ... do something ... Without knowing what the walrus operator is, it is not entirely clear what is going on here. := is only syntactic sug…

Python already has " as " operator that I think is very readable.

  with open('file') as f:
      ... do something ...
I don't know why that didn't come out on top in the debate.

  if re.match(...) as m:
      ... do something ...

Re: What's Coming in Python 3.8

#359
post #344

Earlier quoted context omitted.

Forewarned is forearmed. I headed into adulthood watching out for such mirages. For example: Making sure to listen to pop music enough that it does exactly what pop music is supposed to do (worm its way into your subconscious) so I don't wake up one morning unaccountably believing that Kylie Minogue was good but Taylor Swift isn't. My understanding of Python will probably never be quite as good as my understanding of…

How do you know to listen to Taylor Swift or whatever? In the last century it was easy to be in sync: you could just watch MTV. Is there something keeping the notion of pop coherent these days?

Not exactly pop, but there are some great weekly music podcasts that I listen to to hear new music, which tend to be a little more indie pop/rock/${genre} than pop :)

- Music That Matters: https://omny.fm/shows/kexp-presents-music-that-matters/playl...

- KEXP Song of the Day: https://omny.fm/shows/kexp-song-of-the-day

- All Songs Considered: https://www.npr.org/rss/podcast.php?id=510019

- KCRW Today's Top Tune: https://www.kcrw.com/music/shows/todays-top-tune/rss.xml

Re: What's Coming in Python 3.8

#360
post #8

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 don't think that philosophy was ever truly embraced to begin with. If you want evidence of that try reading the standard library (the older the better) and then try running the code through a linter.
Post reply on HN