News for hackers. Stuff that matters.
Re:What’s New in Python 3.8 by CivBase on Monday October 14, 2019 @06:19PM (#21253489)
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.

The "walrus operator" will occasionally be useful, but I doubt I will find many effective uses for it. Same with the forced positional/keyword arguments and the "self-documenting" f-string expressions. Even when they have a use, it's usually just to save one line of code or a few extra characters.

The labeled breaks and continues proposed in PEP-3136 [0] also wouldn't be used very frequently, but they would at least eliminate multiple lines of code and reduce complexity.

PEP-3136 was rejected because "code so complicated to require this feature is very rare". I can understand a stance like that. Over complicating a language with rarely-used features can definitely create problems. I just don't see why the three "headline" features I mentioned are any different.

[0]: https://www.python.org/dev/peps/pep-3136/

Re:What’s New in Python 3.8 by geofft on Monday October 14, 2019 @07:28PM (#21253983)
> The "walrus operator" will occasionally be useful, but I doubt I will find many effective uses for it.

The primary one I want is

    if m := re.match(...):
        print(m.group(1))
and

    while s := network_service.read():
        process(s)
both of which are both clearer and less error-prone than their non-walrus variants.

The other one that I would have found useful an hour ago is in interactive exploration with comprehensions. I frequently take a look at some data with [i for i in data if i[something].something...], and being able to quickly give a name to something in my conditional, as in {i: x for i in data if x := i[something]}, helps maintain the focus on data and not syntax. Obviously it will get rewritten to have clearer variable names, at the least, when it gets committed as real code, and almost certainly rewritten to be a normal non-comprehension for loop.

Like comprehensions, I expect the walrus operator to be valuable when used occasionally, and annoying if overused. There's no real language-level solution to bad taste. In Python 3 you can now do [print(i) for i in...], and I occasionally do at the REPL, but you shouldn't do it in real code and that's not an argument against the language supporting comprehensions.

Re:What’s New in Python 3.8 by drdaeman on Monday October 14, 2019 @08:11PM (#21254277)
Coming from Perl, I used to want this badly, but then I thought that there's absolutely nothing wrong with

    m = re.match(...)
    if m is not None:
        pass
Now, I wonder what you meant saying that single-line version is less error-prone, because I don't think so. I believe they're exactly the same in this regard, except for a bizarre case when someone would bastardize the code by putting some irrelevant lines between the assignment and the comparison, obfuscating the logic.

Also, as I tend to use `if m is not None:` rather than just `if m:` (because I typically don't want to run all that subtle `__nonzero__` magic), it would - subjectively - look less pretty in the one-line version: `if (m := re.match(...)) is not None:`.

Use in the generator expressions to create aliases/shortcuts and avoid repetition is great, though. I love this use case.

Re:What’s New in Python 3.8 by 3PS on Monday October 14, 2019 @08:31PM (#21254396)
The issue, in my opinion, is when you want something like this:

    while m := f(many, args):
        # do stuff with m
Now, if you're writing this in Python 3.7, you often end up with some code duplication:

    m = f(many, args)
    while m:
        # do stuff with m
        m = f(many, args) # duplicate
Or something like this:

    while True:
        m = f(many, args)
        if not m:
            break
        # do stuff with m
Personally, I consider the last version to be the most elegant, but still something of an anti-pattern. So I welcome this new operator.
Re:What’s New in Python 3.8 by hermitdev on Monday October 14, 2019 @09:41PM (#21254814)
I literally wrote your last example twice last week to hash files in 4k chunks. Those 4 lines would be reduced to 1 with the walrus operator. I welcome it, as well.

Edit: 1 line, not 2 (excluding the "do stuff")

Re:What’s New in Python 3.8 by cellularmitosis on Tuesday October 15, 2019 @12:07PM (#21260013)
This comes up in recursive descent implementations as well https://gist.github.com/cellularmitosis/53913ad229bad5d0a3bb...
Re:What’s New in Python 3.8 by ygrechuk on Monday October 14, 2019 @10:22PM (#21255033)
Why not something like this:

  def f_iter(many, args):
      while True:
          m = f(many, args)
          if m:
              yield m
          else:
              raise StopIteration
  ...
  for m in f_iter(many, args):
      # do stuff with m
This way you’re isolating all the initialization logic, error handling, etc. And you can focus on your domain logic in your client code.
Re:What’s New in Python 3.8 by bvrmn on Tuesday October 15, 2019 @10:54AM (#21259059)
Python has built-in facilities for that, there is no need to write wrapper by yourself.

   from functools import partial
   with open('mydata.db', 'rb') as f:
       for block in iter(partial(f.read, 64), b''):
           process_block(block)
Re:What’s New in Python 3.8 by ciupicri on Tuesday October 15, 2019 @10:03AM (#21258420)
Instead of raising StopIteration you could also just return from the function. You could also make it a bit shorter if you swap the if branches.

  def f_iter(many, args):
      while True:
          m = f(many, args)
          if not m:
              return
          yield m
Re:What’s New in Python 3.8 by zb on Tuesday October 15, 2019 @10:12AM (#21258523)
Instead of raising StopIteration you have to return from the function, otherwise you'll just get a RuntimeError starting with Python 3.7.
Re:What’s New in Python 3.8 by ciupicri on Tuesday October 15, 2019 @11:20AM (#21259375)
You're right. The [changelog] for Python 3.7 states:

> [bpo-32670]: Enforce [PEP 479] for all code. This means that manually raising a StopIteration exception from a generator is prohibited for all code, regardless of whether ‘from __future__ import generator_stop’ was used or not.

[changelog]: https://docs.python.org/3.7/whatsnew/changelog.html#id115

[bpo-32670]: https://bugs.python.org/issue32670

[PEP 479]: https://www.python.org/dev/peps/pep-0479/

Re:What’s New in Python 3.8 by repsilat on Monday October 14, 2019 @10:37PM (#21255107)
And less reasonably, something similar for regular expressions:

    for m in filter([re.match(...)], bool):
        ...
;-)
Re:What’s New in Python 3.8 by mlevental on Tuesday October 15, 2019 @12:03AM (#21255459)
so i should write a whole other function that iterates over a list instead of being happy that := exists?
Re:What’s New in Python 3.8 by throwaway744678 on Tuesday October 15, 2019 @03:47AM (#21256368)
Yes! No pain, no gain!
Re:What’s New in Python 3.8 by pyrale on Tuesday October 15, 2019 @03:51AM (#21256383)
The last version clearly exposes that you have an infinite loop. This is something hidden by the `while(evaluate)` expression.

Also if it comes to pure form I would have preferred `while (evaluate) as x:` out of establishing a parallel with existing syntax, but that's not very important.

Re:What’s New in Python 3.8 by pdpi on Tuesday October 15, 2019 @04:34AM (#21256590)
On the contrary: the loop isn’t fundamentally infinite, it’s just an artefact of the language that you have to write it that way. The walrus lets you put the termination where it belongs.
Re:What’s New in Python 3.8 by pyrale on Tuesday October 15, 2019 @07:44AM (#21257489)
I don't understand that the walrus has any significance with regards to the `while` loop termination. it's the nature of the evaluated expression that makes a difference, more precisely, whether it will return something that is cast to False.

In that sense, while loops over expressions always require knowledge of the expression to understand the semantic. On the other hand, something like:

    while True:
       with x as y:
           print(y)
would not require understanding of x to understand the intent. Therefore it is not semantically equivalent to:

    while x as y:
        print(y)
Note that in both cases, `:=` is strictly equivalent to `as` as it is defined for `with`. That is a matter of personal preference.
Re:What’s New in Python 3.8 by xapata on Tuesday October 15, 2019 @01:43AM (#21255840)
That last one isn't an anti-pattern. That's the pattern concluded best for do-while in the discussion of PEP-315.

https://www.python.org/dev/peps/pep-0315/#notice

Re:What’s New in Python 3.8 by eesmith on Tuesday October 15, 2019 @06:22AM (#21257119)
Think about if you match multiple patterns:

    for line in f:
      if (m:= pat1.search(line)) is not None:
        ... do stuff ..
      elif (m:= pat2.search(line)) is not None:
        ... do other stuff ..
      elif (m:= pat3.search(line)) is not None:
         ... do something else ..
In older Python that's:

    for line in f:
      m = pat1.search(line)
      if m is not None:
        ... do stuff ..
      else:
        m = pat2.search(line)
        if m is not None:
          ... do other stuff ..
        else:
           m = pat3.search(line)
           if m is not None:
             ... do something else ..
I think the newer makes it clear that it's supposed to be a simple elif chain, where all branches following the same structure.

There are other ways to structure it, but the alternatives I can think of also have their own cumbersome complexities.

Re:What’s New in Python 3.8 by drdaeman on Wednesday October 16, 2019 @12:33AM (#21267061)
If actions are different, I tend to put them in functions (independent testable pieces, yay!) and iterate over a mapping:

    LINE_ACTIONS = (
        (re.compile("pattern 1"), do_stuff),
        (re.compile("pattern 2"), do_other_stuff),
        (re.compile("pattern 3"), do_something_else),
    )
    ...
    for pattern, action in LINE_ACTIONS:
        m = pattern.search(line)
        if m is not None:
            action(m)
            break
Or even use a method registry pattern that would auto-populate LINE_ACTIONS by just declaring the fuctions:

    @action("pattern 1")
    def do_stuff(m):
       ...
Alternatively, I might just break the processing into a function:

    def _process(line):
        m = pat1.search(line)
        if m is not None:
            ... do stuff ...
            return

        m = pat2.search(line)
        if m is not None:
            ... do stuff ...
            return

        m = pat3.search(line)
        if m is not None:
            ... do stuff ...
            return

    _process(line)
Of course, this depends on the purpose. Could be completely inadequate in some situations.
Re:What’s New in Python 3.8 by eesmith on Wednesday October 16, 2019 @05:50AM (#21268664)
Indeed, I've also used this pattern.

I've found that I don't like using it. As you write, it's "inadequate in some situations", which I consider as part of the cumbersome complexities I mentioned.

For examples, do_stuff() and do_other_stuff() may need to share variables, and do_something_else() might need the line number to report an error while the others don't.

This can be handled with shared state/nonlocal, and by passing in more parameters to the generic handler API, but these add complexity.

Or, different parts of the file may have different line dispatch processing (eg, a header block followed by a data block followed by a footer block) where one of the handlers must indicate the transition to a different processor.

Also, function dispatch in CPython is slow. While the regex tests are also slow, it can also be important to consider the (using a hypothetical number) 5% overhead for dispatching over inline code.

Re:What’s New in Python 3.8 by kstrauser on Tuesday October 15, 2019 @12:22PM (#21260223)
That's... lovely. I propose making this the standard example of why you might want to use the walrus operator.
Re:What’s New in Python 3.8 by Alex3917 on Monday October 14, 2019 @11:46PM (#21255377)
If you only have one or two regex like that then there is no difference in readability. If you have ten in a row though then suddenly your function no longer fits on the screen and it’s more difficult to understand what’s going on.
Re:What’s New in Python 3.8 by bandrami on Tuesday October 15, 2019 @02:26AM (#21256014)
I mean, what you really want in this case is Perl's =~ operator, as well as the implicit $_ variable.
Re:What’s New in Python 3.8 by est on Monday October 14, 2019 @09:32PM (#21254765)
IMHO the whole `re.match` is a design flaw in stdlib.

re.match() should always return a match object, but instead .group(1) will return None. Then we can write one-liners easier without the walrus operator.

Re:What’s New in Python 3.8 by nine_k on Monday October 14, 2019 @09:45PM (#21254833)
Sometimes you just check for a match (e.g.of entire string) and define no groups.

The problem is not in re.match but in None being a relatively poor Maybe / Optional (still ways better than C-style `null` of many other languages).

Re:What’s New in Python 3.8 by geofft on Tuesday October 15, 2019 @07:36AM (#21257455)
Could just have been

    if re.match(...).matched:
But yeah, agree that Optional is what I want here.

    if let Some(m) := re.match(...)
        m.group(1)...

    m = re.match(...)
    m.group(1) # TypeError because I haven't unwrapped the Optional
In current Python, that last line sometimes throws a runtime error.
Re:What’s New in Python 3.8 by est on Monday October 14, 2019 @09:46PM (#21254836)
> Sometimes you just check for a match

re.match vs re.search

Re:What’s New in Python 3.8 by Liquid_Fire on Tuesday October 15, 2019 @07:23AM (#21257389)
re.search is different. re.match matches from the beginning of the string, while re.search matches from anywhere in the string.
Re:What’s New in Python 3.8 by eesmith on Tuesday October 15, 2019 @06:32AM (#21257162)
I think you mean .group(0) as .group(1) can already return None:

    >>> import re
    >>> pat = re.compile("(A+)|(B+)")
    >>> m = pat.search("HUBBLE")
    >>> m.group(1) is None
    True
    >>> m.group(2)
    'BB'
    >>> m.group(0)
    'BB'
I don't see how using your proposed change would help.
Re:What’s New in Python 3.8 by est on Wednesday October 16, 2019 @01:08AM (#21267239)
I mean re.search() should always return a MatchObject, dont return None.
Re:What’s New in Python 3.8 by Elrac on Tuesday October 15, 2019 @06:30AM (#21257152)
Looking at your wish for exploratory evaluations in for-comprehensions, I was reminded of how Clojure does this. I found it quite elegant.

The inside of the for-braces allow for keyword-based sub-clauses: There's

- ":when" which will suppress output for elements not matching a filter expression,

- ":while" which will stop when elements stop matching a filter, and

- ":let" which will let you bind some new values in mid-loop.

I rarely need these features, but when I do I find them really really helpful. Maybe someday someone will consider doing something similar in Python.

Re:What’s New in Python 3.8 by hchasestevens on Tuesday October 15, 2019 @07:22AM (#21257387)
Your second use case is actually already covered in Python, assuming you have some kind of sentinel value you can break on:

  for s in iter(network_service.read, ''):
      process(s)
Re:What’s New in Python 3.8 by xg15 on Tuesday October 15, 2019 @02:54AM (#21256137)
I think there are a lot of use-cases for some kind of dedicated "if-with-outputs" syntax, where you have some extra variables available inside the if-block if the condition matched. Such a syntax could cover a lot of the problems of double execution but also prevent hard to understand code like the walrus operator.

... I've got no idea how the syntax could look though.

Re:What’s New in Python 3.8 by Sean1708 on Tuesday October 15, 2019 @03:17AM (#21256251)
How would this hypothetical syntax differ from the walrus operator? I.e. what is hard to understand with the walrus operator that wouldn't be with this new hypothetical syntax and why?
Re:What’s New in Python 3.8 by xg15 on Wednesday October 16, 2019 @02:22AM (#21267604)
I think it could avoid cases where you "abuse" the walrus operator and make code harder to understand than necessary. E.g. things like:

  if (value := func()) and another_condition:
    ...
Or:

  if another_condition or (value := func()):
    ...
Or:

  x=1
  my_list = [x := x+1, x := x-1]
etc.
Re:What’s New in Python 3.8 by Sean1708 on Wednesday October 16, 2019 @07:06AM (#21269079)
Ah ok, so you'd essentially allow it in fewer contexts? I would definitely have supported that, although I do think combining walrus with other boolean expressions in if and while is super useful and not particularly hard to understand.
Re:What’s New in Python 3.8 by mixmastamyk on Tuesday October 15, 2019 @05:32PM (#21264074)
It comes up somewhat rarely but it is useful at times. But of those rare times, it is exceedingly rare to require any more complexity than you've shown above, such as having two assignments in one statement.

That was the reasoning given for using ":=" instead of "as", to allow more complexity. I still think it was a mistake.

Re:What’s New in Python 3.8 by kolinko on Tuesday October 15, 2019 @07:04AM (#21257313)
> while s := network_service.read(): > process(s)

Watch out with this one though. In this case it's good, but if you receive numbers from such function, it will break loop not just on None but on 0 as well. Easy to forget.

In many cases you'll need to do:

    while (s:= ....) is not None:
Re:What’s New in Python 3.8 by trymas on Tuesday October 15, 2019 @03:57AM (#21256412)
IMHO walrus operator goes against the zen of python.

https://www.python.org/dev/peps/pep-0572/#differences-betwee...

https://www.python.org/dev/peps/pep-0572/#relative-precedenc...

Even examples of the spec shows how unintuitive and "unpythonic" this is. Explicit is better than implicit.

IMHO adding features to the language to save 1 line of code for 10% of cases when you need it (I agree that there's occasional case when walrus will save you more than 1 line) is just bloat.

I am not a big proponent of Go, because it has its own flaws, though language is indeed very simple and creators of the language try to leave it simple.

IMO Python was very readable, super simple, intuitive and should stay that way, though recent releases show that Python is giving in for the feature bloat.

EDIT:

> Try to limit use of the walrus operator to clean cases that reduce complexity and improve readability.

Facepalm.

Re:What’s New in Python 3.8 by bouncing on Tuesday October 15, 2019 @05:57AM (#21256996)
I've been using Python since 1.5 and I feel like the language itself has been feature-complete for some time. In the 2.0 era, the big pain points were async and unicode; as demonstrated by, well, how painful Twisted's unicode was. ;)

But now if our big paint point is assigning a variable to len(), then in two lines evaluating that variable and printing it out, Python is just trying to find stuff to add.

I miss the size and simplicity of old Python. :/

Re:What’s New in Python 3.8 by newen on Tuesday October 15, 2019 @10:40AM (#21258887)
Yeah. I don't like this obsession that so many developers have with adding features without end. I think it's mostly so that they can have something to do; don't think about the bigger problems, just have something to do so that they can fill out their timesheets and submit it at the end of the week.
Re:What’s New in Python 3.8 by tvelichkov on Tuesday October 15, 2019 @09:53AM (#21258326)
Well the zen of python also states:

- Complex is better than complicated.

Using the walrus operator makes the code more complex, but less complicated.

Re:What’s New in Python 3.8 by lolsal on Tuesday October 15, 2019 @12:23PM (#21260239)
I vehemently disagree - these walrus vars are still in scope outside of the condition block. And on top of that, now there are special conditions for these walrus vars which are completely not obvious.

Reference: https://www.python.org/dev/peps/pep-0572/#scope-of-the-targe...

Re:What’s New in Python 3.8 by trymas on Tuesday October 15, 2019 @10:14AM (#21258544)
It also states one line before:

> Simple is better than complex.

I understand that nobody will force me to use this feature, but as I said before, even the spec and the write up tells how this feature is confusing and .. complex.

Re:What’s New in Python 3.8 by tvelichkov on Wednesday October 16, 2019 @01:28AM (#21267331)
> It also states one line before

I know and I believe there is a purpose to be exactly after that line. Writing only simple code is not enough. If you write everything in a simple manner your code will most likely be complicated, that's exactly why you have next - complex is better than complicated.

I see this feature the same way as comprehensions, scary and complex at first, but once you learn it you would wish anyone would use it.

Re:What’s New in Python 3.8 by paulddraper on Monday October 14, 2019 @07:38PM (#21254049)
> 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?

Re:What’s New in Python 3.8 by CivBase on Monday October 14, 2019 @08:00PM (#21254200)
The f-strings from 3.6 are a (relatively) recent feature that I have absolutely loved. I'd go so far as to say they are my favorite feature introduced by Python 3.

I'm also looking forward to PEP-554 [0], which allows for "subinterpreters" for running concurrent code without removing the GIL or incurring the overhead of subprocesses.

[0] https://www.python.org/dev/peps/pep-0554/

Re:What’s New in Python 3.8 by hannibalhorn on Tuesday October 15, 2019 @08:09AM (#21257605)
Sounds like PEP-544 is actually included in 3.8 on a "provisional" basis, which I guess just means they reserve the right to change the API. That's a killer feature for me, thanks for pointing it out!
Re:What’s New in Python 3.8 by hannibalhorn on Wednesday October 16, 2019 @09:46AM (#21270246)
Correction: So the PEP said it'll be in 3.8, but apparently it's been postponed to 3.9.
Re:What’s New in Python 3.8 by dgrunwald on Wednesday October 16, 2019 @04:36PM (#21275270)
As someone familiar with the Python C extension API, I somewhat doubt that it'll make 3.9 either. Disclaimer: I'm only familiar with CPython as a user of the extension API; I have no idea on how the Python team plans to address the challenges I'm mentioning here, and what their current progress is.

The current extension module API encourages global state, e.g. types (and objects too) are allocated statically in a global C variable. For example, there is a global C variable `_Py_NoneStruct` that is the Python `None` value, and extension modules are accessing this variable directly.

Every use of this object needs to adjust its reference count, and that reference count is directly stored within the C global variable.

`_Py_NoneStruct` is currently even exposed in the PEP 384 stable ABI. Existing extension module binaries are commonly directly touching `_Py_NoneStruct.ob_refcnt` without any synchronization. Breaking the PEP 384 compatibility promise is fundamentally unavoidable here.

One of two things must happen: Alternative one: All refcount operations must be made atomic for thread-safety. These are really really common in the Python interpreter, but atomic operations are expensive on modern CPUs (especially if there's contention). But multiple threads using the value `None` would be quite common in Python code, so I doubt you'd gain any speed even at today's core counts -- in fact I'd expect the constant inter-CPU-communication for the refcounts to make everything slower than just using a single core with today's Python!

So alternative two, ensure no Python objects are shared between the subinterpreters. That's the plan. But that also means it's a breaking change for extension modules. And it's not just an ABI change (which would be handled by merely recompiling against the new headers). Any extension modules that do not yet support PEP 489 are already incompatible with subinterpreters, so that will take quite a bit of work until the ecosystem is upgraded. But there will probably also be some other breaking API changes. I think type objects are currently shared across subinterpreters, and those are frequently defined as a `Py_TypeObject` global variable in extension module code. Also, if every subinterpreter has its own GIL, extension modules calling `PyGILState_Ensure()` will have to specify which subinterpreter they will be using, so that the appropriate lock can be acquired.

My prediction: 3.9 may have the basic functionality, but it still won't be able to run on multiple cores concurrently. That will take a bunch of more work and breaking changes, and will likely be released as Python 4.0.

There will be another slow upgrade process ("my dependencies must upgrade before I can") until the Python ecosystem is multi-subinterpreter-compatible. But at least this one only affects extension modules.

Re:What’s New in Python 3.8 by enriquto on Tuesday October 15, 2019 @03:11AM (#21256210)
f-strings are great. Much nicer than ".format". I hope in a next iteration of the language all strings will be f-strings by default, avoiding the need to prefix them by a silly "f".
Re:What’s New in Python 3.8 by rolux on Tuesday October 15, 2019 @03:40AM (#21256345)
That would of course be an absolute disaster, given that any user input could easily leak internal state and/or break your program.
Re:What’s New in Python 3.8 by enriquto on Tuesday October 15, 2019 @04:22AM (#21256526)
I meant for inline strings (i.e., typed by the programmer). This is an inoffensive change. The only possible ``accident'' is when the programmer wants to write "{x}" instead of the value of x. This is such and exceptional case that it may be best treated by forcing to escape the curly brackets.

If anything, user-input strings must be treated as tainted whatever the case.

Re:What’s New in Python 3.8 by eesmith on Tuesday October 15, 2019 @06:44AM (#21257214)
A quick look at the Python stdlib gives shows some of the breakage that would occur:

1) existing uses of .format() would break:

   aifc.py: raise Error('marker {0!r} does not exist'.format(id))
2) existing uses of "%" formatting would break:

    argparse.py: result = '{%s}' % ','.join(choice_strs)
3) many regular expressions would break:

    uuid.py: if re.fullmatch('(?:[0-9a-f][0-9a-f]-){5}[0-9a-f][0-9a-f]', value):
4) existing strings which contain uuids would break:

    uuid.py: >>> x = uuid.UUID('{00010203-0405-0607-0809-0a0b0c0d0e0f}')
Re:What’s New in Python 3.8 by ptx on Tuesday October 15, 2019 @07:57AM (#21257555)
Then you would run into the same problem Kotlin has with its raw strings – the brackets need to be escaped, but raw strings disable escaping, so you'd have to write r"{}" as r"{'\{\}'}" which is quite ugly and not very raw at all.
Re:What’s New in Python 3.8 by Grue3 on Tuesday October 15, 2019 @09:16AM (#21257997)
It's not an exceptional use case at all. f-strings are pretty much useless for any non-trivial formatting:

1) customizable templates (can't allow the user to access arbitrary variables)

2) i18n (can't allow the translator to access arbitrary variables)

3) complex values being passed to .format() instead of some variable

Re:What’s New in Python 3.8 by duckerude on Tuesday October 15, 2019 @06:35AM (#21257174)
That would break any existing strings that use curly braces, including most legacy use of str.format and docstrings that include code examples with dictionaries. It would be a big backward compatibility issue.
Re:What’s New in Python 3.8 by BerislavLopac on Tuesday October 15, 2019 @06:02AM (#21257022)
Explicit is better than implicit.
Re:What’s New in Python 3.8 by enriquto on Tuesday October 15, 2019 @06:04AM (#21257031)
Sure, the curly brackets are explicit enough. What do you mean?
Re:What’s New in Python 3.8 by glic3rinu on Tuesday October 15, 2019 @04:17AM (#21256508)
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.
Re:What’s New in Python 3.8 by paulddraper on Tuesday October 15, 2019 @12:44PM (#21260503)
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 by Rotareti on Tuesday October 15, 2019 @04:51PM (#21263591)
> I wonder if there is anything that can really be done, outside of something like Cython.

I compile my cli tools with nuitka [0], the resulting binaries take half the time to start. I find the difference quite notable.

[0]: https://github.com/Nuitka/Nuitka

Re:What’s New in Python 3.8 by glic3rinu on Tuesday October 15, 2019 @05:10PM (#21263821)
The interpreter loads reasonably fast, takes around 20-40ms. And it's even faster if "import site on initialization" is disabled.

But startup time increases an order of magnitude once you start importing 'requests' and other common packages.

Perhaps an option to turn imports lazy...

Re:What’s New in Python 3.8 by levi_n on Monday October 14, 2019 @10:21PM (#21255029)
Though not a language feature per say, I would love if the language would take on the packaging ecosystem and deliver a ground up approach that isn't just a kludge on a kludge on a kludge.
Re:What’s New in Python 3.8 by takeda on Tuesday October 15, 2019 @01:59AM (#21255890)
It's not great, but also it isn't terrible, the problem with Python packaging is that there were many ways to do it and people are confused. What's worse, there are tons of articles (in including from PyPA) that are providing bad information.

If you use setuptools and place all your configuration declaratively in setup.cfg it is not that bad.

Re:What’s New in Python 3.8 by xapata on Monday October 14, 2019 @11:31PM (#21255322)
Unfortunately, that'd mean a package manager for C, Fortran, etc. as well, since so many Python packages have non-Python dependencies.

I've started using Docker for ensuring prod behaves the same as dev. Going from Mac dev to Linux prod would otherwise cause trouble.

Re:What’s New in Python 3.8 by j88439h84 on Tuesday October 15, 2019 @05:45AM (#21256933)
Sounds like Conda.
Re:What’s New in Python 3.8 by xapata on Wednesday October 16, 2019 @04:31PM (#21275193)
Conda can't fix some problems, like Python 3.7 wanting ncurses >6, but a dependency wanting ncurses 5.9
Re:What’s New in Python 3.8 by shaklee3 on Tuesday October 15, 2019 @12:44AM (#21255631)
I've heard people recommend poetry on here as something that is good for package management, but I haven't tried it. Does anyone know of something like that, but also can build your application into a Docker container as well?
Re:What’s New in Python 3.8 by penagwin on Tuesday October 15, 2019 @01:12AM (#21255728)
Into a docker container as well? The package manager isn't really related to docker though?

Does your container expose ports or need volumes? Does it need gunicorn or uwsgi in front of it? What about system packages? None of those (except maybe the last one) are really in the scope of the package manager.

Re:What’s New in Python 3.8 by shaklee3 on Tuesday October 15, 2019 @09:16AM (#21258000)
The main use case is I have a project with a setup.py that has the normal stuff in it, and there's a main entry point in one of the files. I then make a dockerfile that installs that package in a container and runs the main file as the entry point. Ignoring things like ports, it would be nice to emit a standard dockerfile like that, since it's very common.
Re:What’s New in Python 3.8 by jakeogh on Monday October 14, 2019 @10:45PM (#21255138)
You might like portage. We have USE flags (which are ./configure --stuff), slots (so you can install multiple versions in a clean way), and any kind of dependency tree you can think of. When I am thinking of upgrading the system python, I can enable the next version and let things simmer for testing (building for py3.7 and 3.8 for example) before I actually throw the switch (eselect python set N).
Re:What’s New in Python 3.8 by jhanschoo on Tuesday October 15, 2019 @12:05AM (#21255466)
While not official, doesn't conda solve this problem? (Except for not containing the latest versions).
Re:What’s New in Python 3.8 by edflsafoiewq on Monday October 14, 2019 @10:14PM (#21254985)
I'd really like a way to refer to a variable in a outer scope (like global... but not just for global variables).
Re:What’s New in Python 3.8 by paultudorjones on Monday October 14, 2019 @10:26PM (#21255047)
Re:What’s New in Python 3.8 by eru on Tuesday October 15, 2019 @02:16AM (#21255961)
In the same vein, they could add syntax to distinguish introducing a variable from setting the value of an existing variable.

Python's heuristics for that are pretty annoying.

Re:What’s New in Python 3.8 by arnsholt on Tuesday October 15, 2019 @04:19AM (#21256518)
I think that feature has exactly zero chances of getting adopted, but that's probably one of my top Python annoyances too.

If it's any consolation, the scope of a variable isn't determined by heuristics, it's just that the rules are (IMO) kinda bad. Basically, if a variable is assigned (in addition to `=` and friends, `import`, `class` and `def` are also assignments in disguise) to in what Python calls a "block" (which is not like a C-style block; rather `class` body, `def` body, or top-level) it is considered to belong to that block (with the notable exception of the name for a caught exception in a `except Exception as e: ...`, see [1]). If you want it to refer to a variable outside the block, you need to use `global` or `nonlocal` as appropriate. The full gory details are in [2]

1: https://docs.python.org/3/reference/compound_stmts.html#the-...

2: https://docs.python.org/3/reference/executionmodel.html#nami...

Re:What’s New in Python 3.8 by eru on Tuesday October 15, 2019 @06:12AM (#21257071)
Yes, I meant the rules are bad. I called them heuristics, because I assume they came up with the rules as a heuristic to what would be the most useful behaviour.

Python didn't use to have lexical scoping, so the rules are retrofitting around that.

Re:What’s New in Python 3.8 by arnsholt on Tuesday October 15, 2019 @07:54AM (#21257540)
Yeah, it all seems a bit hacky. Especially the bit where a caught exception bound to a variable is cleared at the end of the `except` clause. I'm pretty sure it's because if you didn't you'd get a reference cycle (exception object -> stack trace -> function invocation record -> function locals -> exception object), which makes CPython's GC sad.
Re:What’s New in Python 3.8 by alanfranz on Tuesday October 15, 2019 @02:46AM (#21256107)
... and what prevents you from doing that? You mean you'd want to reassign them?
Re:What’s New in Python 3.8 by manojlds on Tuesday October 15, 2019 @01:11AM (#21255725)
Yeah the fact that a new release is boring is a good thing.
Re:What’s New in Python 3.8 by Grue3 on Tuesday October 15, 2019 @09:20AM (#21258037)
Multi-line/multi-expression lambdas.

"end" statement which would enable automatic indentation.

"switch" statement instead of "if/elif/.../else" hell.

Re:What’s New in Python 3.8 by ktpsns on Tuesday October 15, 2019 @09:33AM (#21258155)
Oh yes, too all of them!

Correctly done multi-line lambdas/expressions could bring Python's expressivitiy to where ECMAScript is nowadays, where you can write both foo = function(...) or function foo().

Perl 6 has a great switch statement, called "given" https://docs.perl6.org/language/control#given

Re:What’s New in Python 3.8 by Franciscouzo on Tuesday October 15, 2019 @12:26AM (#21255559)
A null coalescing operator
Re:What’s New in Python 3.8 by j88439h84 on Tuesday October 15, 2019 @05:48AM (#21256948)
There was a now-deferred PEP for 3.8 https://www.python.org/dev/peps/pep-0505/
Re:What’s New in Python 3.8 by metalforever on Tuesday October 15, 2019 @09:31AM (#21258136)
I would honestly like an option to "compile" python to check for typing inconsistencies with the type hinting introduced in Python 3. Also, the multithreading story is kinda shitty
Re:What’s New in Python 3.8 by Rotareti on Tuesday October 15, 2019 @05:28PM (#21264032)
> I would honestly like an option to "compile" python to check for typing inconsistencies

You can use mypy for that: https://github.com/python/mypy

Re:What’s New in Python 3.8 by j88439h84 on Tuesday October 15, 2019 @12:49AM (#21255654)
Pattern matching. Quasiliterals. PSF support for Poetry or PyPy.
Re:What’s New in Python 3.8 by jp_sc on Monday October 14, 2019 @10:34PM (#21255086)
I would love if they added "?" to the list of valid characters for names, so I could write something like `valid?()` instead of ``is_valid()`.
Re:What’s New in Python 3.8 by bandrami on Tuesday October 15, 2019 @02:31AM (#21256035)
just use "_P", a fairly-widely-recognized substitute from the Lisp world.
Re:What’s New in Python 3.8 by maksimum on Tuesday October 15, 2019 @02:39AM (#21256075)
As a python programmer I would have no idea what `valid_P` is supposed to mean. Valid Pascals?
Re:What’s New in Python 3.8 by bandrami on Tuesday October 15, 2019 @02:52AM (#21256134)
P is shaped like a question mark, though I think it was retronymed to stand for "Predicate"
Re:What’s New in Python 3.8 by NateEag on Tuesday October 15, 2019 @07:29AM (#21257418)
I think "predicate" is the original meaning of that postfix.

Emacs Lisp, at least, can use question marks in names without batting an eyelash.

I see no reason that would not have been true for Lisps generally since their birth.

Re:What’s New in Python 3.8 by ptx on Tuesday October 15, 2019 @08:05AM (#21257592)
The suffix is just "p" in Common Lisp[1], so I think the "predicate" explanation is more likely to be correct than the visual analogy to the question mark.

[1] http://www.lispworks.com/documentation/HyperSpec/Body/f_list...

Re:What’s New in Python 3.8 by cutler on Tuesday October 15, 2019 @07:54AM (#21257543)
Or even better, just `valid?` Oh, wait .... that's Ruby.
Re:What’s New in Python 3.8 by alanfranz on Tuesday October 15, 2019 @02:45AM (#21256101)
Ruby to the rescue!
Re:What’s New in Python 3.8 by themeiguoren on Wednesday October 16, 2019 @06:51AM (#21268987)
I want to build executables that I can pass around without also sending an entire environment. Crazy that’s not a native feature.
Re:What’s New in Python 3.8 by bouncing on Tuesday October 15, 2019 @05:58AM (#21257003)
Honestly? Performance and the possibility of making Pypy the reference implementation.
Re:What’s New in Python 3.8 by KaiserPro on Tuesday October 15, 2019 @09:09AM (#21257949)
proper threads.
Re:What’s New in Python 3.8 by thayne on Monday October 14, 2019 @07:15PM (#21253902)
There have been many times when I've wished python had something like the walrus operator.

In particular, without the walrus operator you can't write an if-elif chain of regex comparisons. The best way to that that I've been able to find is with a bunch of nested if-else statements.

Re:What’s New in Python 3.8 by Sean1708 on Tuesday October 15, 2019 @03:28AM (#21256295)
And working with queues/stacks is much more pleasant (which I seem to do a lot...).
Re:What’s New in Python 3.8 by kolinko on Monday October 14, 2019 @06:50PM (#21253705)
I actually found an immense use for Walrus - used it to hack Python into doing pattern matching that is way more readable than without it:

https://github.com/eveem-org/panoramix

(source code for Eveem.org, which is arguably the best decompiler for Ethereum smart contracts out there. you can see a lot of pattern matching in pano/simplify.py , and I found no way to do it without extending the language/walrus while maintaining the readability)

Re:What’s New in Python 3.8 by onlyrealcuzzo on Monday October 14, 2019 @07:15PM (#21253898)
Just a suggestion...

I went to your repo, and it wasn't clear to me what Panoramix actually is or does. So I checked out Eveem.org, and even on the about page, it wasn't clear to me what Eveem was.

But with that context, coming back to your GitHub page, I was able to get the gist of it.

It might be helpful to have a section above the installation section that gives a little context / tells about the project.

And in your example section -- again, I literally don't know anything about decompilation so maybe I'm not your target demographic... but if I understand the gist of it, kitties is an example function or binary. It might be better to use something more concrete (and provide the context).

Re:What’s New in Python 3.8 by kolinko on Tuesday October 15, 2019 @04:51AM (#21256679)
Thank for the feedback! My first open-source project. I will improve this :)
Re:What’s New in Python 3.8 by gizmo385 on Monday October 14, 2019 @06:57PM (#21253756)
After a quick read through, I personally find this syntax much harder to read using operator overloads than it would have been using a series of comparison functions. Tilde is a very obtuse operator and I don't know that this really buys you anything.

Feels like a case of preferring cleverness over readability/usability/maintainability.

Re:What’s New in Python 3.8 by MichaelMoser123 on Tuesday October 15, 2019 @01:33AM (#21255800)
Python is adding features, maybe they want to be as expressive as perl, when they grow up; however that comes with the price of decreased readability.
Re:What’s New in Python 3.8 by kolinko on Tuesday October 15, 2019 @04:58AM (#21256708)
I actually had a series of comparison functions initially, but those weren't that readable.

To give you an example, let's look at this statement:

if exp ~ ('mask_shl', int:size, int:offset, -offset, :e): ...

It is the same as writing: if type(exp) == tuple and len(exp) == 5 and exp[0]=='mask_shl' and type(exp[1])==int aand type(exp[2])==int and exp[3] == -exp[1]: size, offset, e = exp[1], exp[2], exp[4] ...

If you can figure out syntax that makes this sort of matches more readable, I'll gladly use it :)

Re:What’s New in Python 3.8 by kolinko on Tuesday October 15, 2019 @07:05AM (#21257319)
Fixing formatting for above:

    if exp ~ ('mask_shl', int:size, int:offset, -offset, :e): ...
vs

    if type(exp) == tuple and len(exp) == 5 and exp[0]=='mask_shl' and type(exp[1])==int aand type(exp[2])==int and exp[3] == -exp[1]: 
        size, offset, e = exp[1], exp[2], exp[4] 
        ...
Re:What’s New in Python 3.8 by mark-r on Monday October 14, 2019 @08:24PM (#21254351)
Exactly the road C++ tries to go down. How's that for a ringing endorsement?
Re:What’s New in Python 3.8 by wolco on Monday October 14, 2019 @08:56PM (#21254548)
C++ is one of the most successful languages.
Re:What’s New in Python 3.8 by nine_k on Monday October 14, 2019 @10:45PM (#21255134)
Despite its flaws, not due to them.

Same can be said about e.g. Cobol.

Re:What’s New in Python 3.8 by eru on Tuesday October 15, 2019 @02:18AM (#21255972)
Despite the flaws, and because of being in the right place at the right time.

Cobol also was a good idea back in the day. And some of the ideas in Cobol we know recognize as bad _had_ to be tried to gain that recognition.

Re:What’s New in Python 3.8 by otabdeveloper4 on Tuesday October 15, 2019 @03:02AM (#21256170)
False.

There have been dozens of working C++ competitors over the years, each one technically as good as C++.

They all failed because their authors are good at writing languages, but very bad at knowing how languages are used in the real world.

The C++ committee really knows what it's doing, you're not going to do anything useful in this space without actually understanding the problem domain.

TL;DR - yes, C++ is complex, but that is because programming is complex. Your attitude of "programming is hard, let's go (language) shopping" will not displace C++.

Re:What’s New in Python 3.8 by nine_k on Tuesday October 15, 2019 @09:04AM (#21257913)
C++ made a number of... unfortunate decisions early in its development, which resulted in a much worse language than it could have been. (Hindsight is 20/20, of course.)

I totally agree that C++ of 21st century is way better than C++ from 1998, and is becoming better. The problem is that maintaining backwards compatibility requires to keep a number of footguns in place, and some of them are cornerstones of the language :(

I have high hopes for Rust becoming the more sane competitor in the space traditionally occupied by C++. Its authors seem to understand the problem domain from a very practical standpoint, and are proficient in C++, to begin with. They also strive to apply reasonable design principles, and some actual math hopefully will keep the core of the language from logical pitfalls.

Another example of hitting a sweet spot is Go. I dislike many Go's language decisions. (Some are definitely great, though, e.g. the whole OOP approach lifted from Oberon.) But its authors definitely understand both the problem domain, and the target audience.

This is what I mean by talking about success despite the flaws. C++ has both flaws and merits, and merits outweighed the flaws. But the flaws are still painful.

Re:What’s New in Python 3.8 by mark-r on Tuesday October 15, 2019 @10:59AM (#21259120)
How much of that success can be attributed to the features that were added in the last 10 years?
Re:What’s New in Python 3.8 by raobit on Tuesday October 15, 2019 @01:42AM (#21255834)
Rust:- Am i a joke to you?
Re:What’s New in Python 3.8 by cortesoft on Monday October 14, 2019 @10:29PM (#21255063)
Pretty good?
Re:What’s New in Python 3.8 by Tommah on Monday October 14, 2019 @08:50PM (#21254500)
There is a similar trick that you can use without the walrus operator. I wrote the code many years ago and I am reproducing this from memory, so the code below may be a little off. Define this class:

    class Any:
        def __eq__(self, other):
            self.value = other
            return True
Then you can use an instance of it as the hole in a pattern. My use case was performing peephole optimizations in a simple 6502 assembler. For example, if the LDA operation (load value from memory location into accumulator) occurs twice in a row, the first load is redundant. So I did this test:

    x, y = Any(), Any()
    if L[i:i+2] == [('LDA', x), ('LDA', y)]:
        L[i:i+2] = [('LDA', y.value)]
(Note that the last line changes the length of the list, so it may be slow on large lists.)

I was going to write a blog post about this back then, but I never did. If anyone is interested, I can write it now.

Re:What’s New in Python 3.8 by eru on Tuesday October 15, 2019 @02:19AM (#21255976)
But that breaks normal equality tests for your type?
Re:What’s New in Python 3.8 by heavenlyblue on Tuesday October 15, 2019 @04:46AM (#21256656)
Wouldn’t parent’s code simply copy into Any every time it’s compared in a list?

It is some spooky action at a distance.

Re:What’s New in Python 3.8 by eru on Tuesday October 15, 2019 @06:11AM (#21257065)
Probably. I found it a bit confusing in any case.
Re:What’s New in Python 3.8 by ohazi on Monday October 14, 2019 @07:17PM (#21253915)
You should link to a snippet that actually uses := rather than to the top level project.
Re:What’s New in Python 3.8 by kolinko on Tuesday October 15, 2019 @05:03AM (#21256737)
Ah yes, sorry:

https://github.com/eveem-org/panoramix/blob/bc55be84a9a6abb1...

It uses "~" custom operator, but implementing it would not be possible without ":=" operator (see /tilde directory).

Re:What’s New in Python 3.8 by closed on Monday October 14, 2019 @07:10PM (#21253862)
This is super interesting! I've never seen codecs used to introduce language features like this... Do you have any good references for getting started with using codecs?

Also, I wonder if there's an easy way to implement this in a jupyter notebook, without fiddling with the kernel...

(issues of whether it's a good idea aside, definitely seems useful to know about.. )

Re:What’s New in Python 3.8 by kolinko on Tuesday October 15, 2019 @05:02AM (#21256729)
Thanks! The idea for using codecs is not mine - found it on StackOverflow somewhere. Googling for "how to add custom language statements python" should give you some results, this included :)

Also, in my case I had to use Codecs because a new operator causes AST-parser to not go through. But if you have some kind of syntax that will be compatible with Python AST, then you can implement it even easier.

You can google Python AST to get a lot of useful information :)

Re:What’s New in Python 3.8 by m463 on Tuesday October 15, 2019 @12:19AM (#21255525)
I thought regex matching was one of the strongest arguments for it.
Re:What’s New in Python 3.8 by peterwwillis on Monday October 14, 2019 @07:04PM (#21253808)
Perl devs have been using the walrus expression for decades, but we just called it "assigning a variable with local scope in an expression".

  $ perl
    $a = "foo";
    if ( my $a = "bar" ) { print "$a\n" }
    print "$a\n"
  bar
  foo
Re:What’s New in Python 3.8 by takeda on Monday October 14, 2019 @07:36PM (#21254042)
The reason why assignment expressions initially were not allowed in Python and why they had to introduce "walrus" was because in languages that used single equal sign for assignment enable to easily make bugs by typing "=" instead of "==".
Re:What’s New in Python 3.8 by jaynetics on Tuesday October 15, 2019 @03:28AM (#21256296)
I find it strange to sacrifice syntactical simplicity for bug prevention in a language that needs deep testing anyway because it's neither nil- nor type-safe. But maybe I'm just to used to inline "=".
Re:What’s New in Python 3.8 by pyrale on Tuesday October 15, 2019 @04:13AM (#21256484)
A partial solution was already introduced with `with x as y`.
Re:What’s New in Python 3.8 by geofft on Monday October 14, 2019 @07:34PM (#21254029)
Yup, C and many other languages also have it:

    if (ptr = strchr(address, ':'))
        port = atoi(ptr + 1);
Re:What’s New in Python 3.8 by iso-8859-1 on Monday October 14, 2019 @11:50PM (#21255393)
It doesn't do scoping, so not really the same.
Re:What’s New in Python 3.8 by gpderetta on Tuesday October 15, 2019 @06:06AM (#21257037)
it can in C++ (when specifying auto or a type). I thought it did in C as well, but apparently not.
Re:What’s New in Python 3.8 by emmelaich on Monday October 14, 2019 @08:54PM (#21254528)
As someone who has used Python for over 10 years and C, Perl, etc for over 20, I've been craving the walrus operator forever.

I love the walrus operator with a love that is unholy.

Re:What’s New in Python 3.8 by m463 on Tuesday October 15, 2019 @12:21AM (#21255535)
I wonder what you think of "for else" loops.

(although I think "else" should have been a different keyword)

Re:What’s New in Python 3.8 by dagw on Tuesday October 15, 2019 @03:35AM (#21256323)
Not OP, but I've probably used them 2 or 3 times in the past decade or so and each time it made for a nice solution to the problem I was facing.
Re:What’s New in Python 3.8 by tripzilch on Wednesday October 16, 2019 @08:23AM (#21269586)
Every time I come across a use case when the "for else" construct would be applicable, I decide against using it just because the "else" keyword is just very unintuitive to people not familiar with this rarely used construct ... so yeah, I too wish it was a different keyword :)
Re:What’s New in Python 3.8 by m463 on Wednesday October 16, 2019 @08:31PM (#21277730)
maybe we will get "The 3to4 tool will automatically adapt regretfully-named-keywords when converting your sources to Python 4."
Re:What’s New in Python 3.8 by kccqzy on Tuesday October 15, 2019 @12:00AM (#21255438)
PEP-3136 was proposed and discussed more than 10 years ago in the 2->3 process. The python community was very different then. As an example, Python 3 was also the language that removed the function argument tuple packing, to which my reaction is basically WTF.
Re:What’s New in Python 3.8 by heavenlyblue on Tuesday October 15, 2019 @04:49AM (#21256668)
Is WTF related to the point of efficiency or some esoteric semantics?
Re:What’s New in Python 3.8 by thanatropism on Tuesday October 15, 2019 @10:56AM (#21259077)
> Over complicating a language with rarely-used features can definitely create problems.

Agreed.

There's a number of (full) languages that compile to the Python AST [0] (I'm especially fond of http://hylang.org), but they're very different from Python. It would be interesting to see smaller variations of standard Python implemented in an interoperable way like these languages do.

[0] https://github.com/vindarel/languages-that-compile-to-python

Re:What’s New in Python 3.8 by Iv on Tuesday October 15, 2019 @03:07AM (#21256191)
Not all releases have to be ground breaking, especially in a mature and stable language. Cleaning up things, putting other things in place for major releases, that's commendable too.

I did not follow all the conversation around the typing system but isn't the whole point of it to propose optimizations in the future? I find it exciting

Re:What’s New in Python 3.8 by cutler on Tuesday October 15, 2019 @07:58AM (#21257556)
So Python is finally waking-up to the advantage of everything being an expression as in Ruby and Clojure.
Re:What’s New in Python 3.8 by wodenokoto on Tuesday October 15, 2019 @03:24AM (#21256276)
> Same with the forced positional/keyword arguments

I also thought, why bother at first until I learned this is already a feature in python, but only for c-functions. So of course it makes sense to level the playing field.

Re:What’s New in Python 3.8 by madhadron on Wednesday October 16, 2019 @12:43AM (#21267117)
The audit hooks are going to allow some really interesting things, especially around security controls on executing Python code. There is hope for sandboxed Python execution!
Re:What’s New in Python 3.8 by afiori on Tuesday October 15, 2019 @04:43AM (#21256641)
In my opinion it was a mistake to reject the labelled break PEP
Re:What’s New in Python 3.8 by ageofwant on Monday October 14, 2019 @06:33PM (#21253580)
I take this as a positive sign of Python's maturity.
Re:What’s New in Python 3.8 by smitty1e on Monday October 14, 2019 @06:42PM (#21253646)
. . .and the threat of Just Another Vict'ry Announcement (JAVA) as the need to add "sizzle" to the next version looms.
Re:What’s New in Python 3.8 by chooseaname on Monday October 14, 2019 @07:47PM (#21254111)
Rock and a hard place, no? Either you keep adding to a language and people keep using it, or you stop adding to a language and people call it a dead language and stop using it.

Most devs don't understand that software can be done and still be useful.

Re:What’s New in Python 3.8 by eru on Tuesday October 15, 2019 @02:20AM (#21255987)
Well, you could also try to remove from the language.

Like how they removed the `print` keyword when going from Python 2 to Python 3.

But removing is harder than adding.

Re:What’s New in Python 3.8 by chooseaname on Tuesday October 15, 2019 @08:25AM (#21257677)
Right. Maybe I should have said, "... keep changing a language..."
Re:What’s New in Python 3.8 by egdod on Monday October 14, 2019 @06:48PM (#21253686)
Mature languages don’t introduce random new ugly syntax. I miss Guido already.
Re:What’s New in Python 3.8 by seunosewa on Monday October 14, 2019 @07:07PM (#21253835)
Actually, Guido approved the walrus operator. (In response to the justified backlash, instead of canceling the feature, he resigned as BDFL, which is not what anyone wanted)
Re:What’s New in Python 3.8 by egdod on Monday October 14, 2019 @09:27PM (#21254733)
I stand corrected.
Re:What’s New in Python 3.8 by coldtea on Monday October 14, 2019 @07:03PM (#21253802)
Guido fought to have the "random new ugly syntax" (which is anything bad) included.