Live data from Hacker News

What’s New in Python 3.8

docs.python.org

341–350 of 381 posts

Re: What’s New in Python 3.8

#341

Earlier quoted context omitted.

Forunately, tauthon is a community-supported fork of Python 2.7 so that we may continue using the best version indefinitely.

You'll be laughed out of future interviews if you mention your interest in that project.

Some people use software as a tool and aren't zealots about versions or constantly chasing updates.

Re: What’s New in Python 3.8

#342
post #247

Earlier quoted context omitted.

Not OP, but maybe it's "as": if re.match(pattern, string) as m: #use m Seems a bit more Pythonic, as "as" is already used like this with "with". Either one would be fine with me and useful.

It's already used in imports as well! It was the better choice, I don't know which arguments convinced them otherwise

I think I remember seeing something about the "as" syntax. Wish I could find what I read, IIRC some arguments convinced me that the walrus operator was an improvement.

Re: What’s New in Python 3.8

#343

Earlier quoted context omitted.

> As a developer who has primarily developed applications in Python for his entire professional career, I can't say I'm especially excited about any of the "headlining" features of 3.8. Python is a fairly old, mature language. What features would you have been especially excited about?

I wouldn’t mind cpython performance improvements over language features. Specifically startup time. Py cli tools can easily take up to 300-600ms to start. Now, try to use them for scripting. A single script doing a bunch of calls to python clis has already several seconds of runtime penalty.

I completely agree, but you'll notice similar startup overheads in almost all non-native languages: Java, Ruby, Node.js.

I wonder if there is anything that can really be done, outside of something like Cython.

Re: What’s New in Python 3.8

#344
post #321

Earlier quoted context omitted.

Because if you need to branch based on type more than a few times in your function it can get pretty hard to read. Am I right that the basis of your complaint is that it's now harder to find all the members of (what you'd call in C++) the "overload set" for a particular function? If so I can see your point.

Yes, that's my point. And it doesn't really simplify the function itself, it just rearranges it, in the same way you can break up a complex painting into jigsaw pieces and say, "Look, each piece is simple!"

I think the answer to the question "should I apply X refactoring technique to this function Y?" obviously has to depend on both X and Y. There's clearly a trade-off here. If I have a free function foo(x) that I want to work differently depending if x is type A or type B, splitting that means breaking up foo, sure, but because I can only ever call foo with an x of type A or type B (unless I'm converting some As to Bs halfway through foo or something awful like that) it might be useful to see all of the "A" logic in one place and all of the "B" logic in another place.

Re: What’s New in Python 3.8

#345
post #44

Earlier quoted context omitted.

Yes, "path dependence" is a good way to describe it. (And Python has been my favorite language for 16+ years now) For https://www.oilshell.org/ , which has Python/JS-like functions, I chose to use Julia's function signature design, which is as expressive as Python's, but significantly simpler in both syntax and implementation: Manual: https://docs.julialang.org/en/v1/manual/functions/index.html... Comparison: https:/…

But the Julia syntax can not represent arguments that can be passed either positional or named, right?

Yeah that's true, but I consider it a feature and not a bug.

There was a rule in Google's style guide that said to only pass optional arguments with names, and required args without names. It basically enforced this separation while being slightly less flexible, because you can't have optional positional args or required named args.

Tens of millions of lines of code was written by thousands of programmers in that style, and it caused no problems at all. On the contrary it made code more consistent and readable.

Re: What’s New in Python 3.8

#346
post #342

Earlier quoted context omitted.

It's already used in imports as well! It was the better choice, I don't know which arguments convinced them otherwise

I think I remember seeing something about the "as" syntax. Wish I could find what I read, IIRC some arguments convinced me that the walrus operator was an improvement.

it is discussed in the PEP

https://www.python.org/dev/peps/pep-0572/#alternative-spelli...

Re: What’s New in Python 3.8

#347
post #204

Earlier quoted context omitted.

What's the value of a sorted map over an ordered map? I don't think I've ever cared to iterate over map values based on the alphanumeric ordering of their keys.

In Haskell we use sorted maps as persistent data structures. Persistent in this context means that the insert-method returns a new map and the old map is still around, if you need it. It's basically copy-on-write. The old and new map share all but O(log n) data. You could probably do something like that with an unsorted map, but it's a good fit for a sorted one.

Sure, but fix your comparison metric as "timestamp of insertion" (and forget for a moment that this isn't technically pure, you can fiddle to make it pure), and you still get all the CoW-niceness, but this is internal to the mapping type, my keys and values don't need to be comparable or orderable, only hashable. I'm given an ordering, the ordering is arbitrary, but I don't care, because CoW/persistent hash maps are mostly an implementation detail or optimization.

Re: What’s New in Python 3.8

#348

Earlier quoted context omitted.

> nice mnemonics like these: > option-w ∑ This would grate on me every single time I had to use it. It's an S. Put it on option-s.

For context opt s is ß so the decision wouldn’t be easy if you want to include both.

What are á and à?

Putting double S on option-s just makes option-w for Sigma more grating. If they were going by shape, it'd be on option-b, which is equally stupid. But since it's on S, we can conclude that... someone at Apple knows German, but nobody can even name a Greek letter? That Germans are right and Greeks are wrong? What?

Re: What’s New in Python 3.8

#349
post #341

Earlier quoted context omitted.

You'll be laughed out of future interviews if you mention your interest in that project.

Some people use software as a tool and aren't zealots about versions or constantly chasing updates.

Yeah, and even those people would snort derisively at a project designed to keep 2.7 alive like this.

"Getting shit done" doesn't happen if you can't move forward eventually. I'd have substantial concerns hiring someone who can't get over Python 2.7.

Re: What’s New in Python 3.8

#350

Earlier quoted context omitted.

For context opt s is ß so the decision wouldn’t be easy if you want to include both.

What are á and à? Putting double S on option-s just makes option-w for Sigma more grating. If they were going by shape, it'd be on option-b, which is equally stupid. But since it's on S, we can conclude that... someone at Apple knows German, but nobody can even name a Greek letter? That Germans are right and Greeks are wrong? What?

I don’t think it that extreme, but that German has higher precedence than Greek. If you need to include both characters, you have to pick one or the other, and for whatever reason this configuration happened. We might never know the true reason behind the decision, but stupility is unlikely the answer. Most seemingly stupid decisions (technical or otherwise) makes at least a certain amount of sense within its proper context, and it’s fair to talk down to it when you don’t have the risk of being judged by that decision.
Post reply on HN