What's New in Python 3.15

(docs.python.org)

63 points | by azhenley 3 days ago

7 comments

  • wdroz 21 minutes ago
    In the improved error message [0] how are they able to tell nested attributes without having a big impact in performance? Or maybe this has a big impact on performance, then using exceptions for control flow is deprecated?

        ...
        print(container.area)
    
    > AttributeError: 'Container' object has no attribute 'area'. Did you mean: 'inner.area'?

    [0] -- https://docs.python.org/3.15/whatsnew/3.15.html#improved-err...

  • PaulHoule 3 days ago
    PEP 686 makes me smile

    https://peps.python.org/pep-0686/

  • edflsafoiewq 2 hours ago
    Can definitely think of some places I should use bytearray.take_bytes.
  • pjmlp 1 hour ago
    I am here for the JIT and improved profiling goodies, one day Python will finally be a proper Lisp replacement.

    -- https://www.norvig.com/python-lisp.html

    • nurettin 36 minutes ago
      I had a colleague who was hostile to any language other than common lisp. Except python, which I assume is just because this page exists. What if norvig woke up that day and decided to write about Ruby instead?
  • stabbles 22 minutes ago
    > On POSIX platforms, platlib directories will be created if needed when creating virtual environments, instead of using lib64 -> lib symlink. This means purelib and platlib of virtual environments no longer share the same lib directory on platforms where sys.platlibdir is not equal to lib.

    Sigh. Why can't they just be the same in virtual environments. Who cares about lib64 in a venv? Just another useless search path.

  • ruuda 1 hour ago
    > Python now uses UTF-8 as the default encoding, independent of the system’s environment.

    Nice, not specifying the encoding is one of the most common issues I need to point out in code reviews.

    • franga2000 29 minutes ago
      You mean the coding= comment? Where are you shipping your code that that was actually a problem? I've never been on a project where we did that, let alone needed it.
    • joshribakoff 1 hour ago
      Have you considered reducing review noise by using static analysis?
      • KK7NIL 50 minutes ago
        Yep, ruff has a warning for this exact issue.
    • formerly_proven 31 minutes ago
      encode()/decode() have used UTF-8 as the default since Python 3.2 (soon, 15 years ago). This is about the default encoding for e.g. the "encoding" parameter of open().
  • Erenay09 1 hour ago
    Seeing this reminded me of version 3.14, where π is an infinity expressed through its fractional parts.