Questions tagged [python-3.9]

The latest version of the Python programming language. This tag is for issues that are specific to Python 3.9. For general questions use the more generic [python] and [python-3.x] tags.

3.9 was released on October 5, 2020 (PEP 596).


Use this tag if your question is specifically related to Python 3.9. Otherwise, use the following guidelines to determine which tag(s) you should add to your question:

  • If your question applies to Python in general, use only the tag.
  • If your question applies to Python 3.x but not to Python 2.x, add the tag .
  • If you aren't sure, tag your question with and mention which version you're using in the post.

References

453 questions
103
votes
3 answers

What are "soft keywords"?

According to the documentation of the keyword module, two new members have been added in Python 3.9: issoftkeyword softkwlist However their documentation doesn't reveal anything about their purpose. This change is not even mentioned in the What's…
a_guest
  • 25,051
  • 7
  • 38
  • 80
71
votes
6 answers

AttributeError: module 'importlib' has no attribute 'util'

I've just upgraded from Fedora 32 to Fedora 33 (which comes with Python 3.9). Since then gcloud command stopped working: [guy@Gandalf32 ~]$ gcloud Error processing line 3 of…
Guy Carmin
  • 713
  • 1
  • 3
  • 4
53
votes
4 answers

What is __peg_parser__ in Python?

I was using the keyword built-in module to get a list of all the keywords of the current Python version. And this is what I did: >>> import keyword >>> print(keyword.kwlist) ['False', 'None', 'True', '__peg_parser__', 'and', 'as', 'assert', 'async',…
Abhigyan Jaiswal
  • 2,090
  • 1
  • 5
  • 22
36
votes
3 answers

How to install python3.9 with conda?

I'm trying to install python 3.9 in a conda enviroment. I tried creating a new conda env using the following command, conda create --name myenv python=3.9 But I got an error saying package not found because python 3.9 is not yet released So, I…
bigbounty
  • 13,123
  • 4
  • 20
  • 50
10
votes
1 answer

pip3 on python3.9 fails on 'HTMLParser' object has no attribute 'unescape'

After installing (ubuntu) python3.9, installing some packages with pip failes on: Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 14, in…
borgr
  • 9,229
  • 4
  • 18
  • 31
9
votes
1 answer

When will AWS lambda support python 3.9?

Hi does anyone know how can I find out when will AWS lambda upgrade their support to python 3.9? Last time they upgraded to 3.8 was 2019 and it’s been a while since v3.9 released. I’m keen to use the latest v3.9 language features but sadly can’t do…
James H
  • 366
  • 1
  • 10
8
votes
2 answers

What is wrong with the syntax of this simple Python list?

Maybe I've gotten rusty with Python. Why is this not acceptable when pasted into a Python shell? hdr_filenames = [ "20210311_105300_HDR.jpg", "20210311_105306_HDR.jpg", "20210311_105310_HDR.jpg", "20210311_105314_HDR.jpg", …
DarenW
  • 15,697
  • 7
  • 59
  • 96
8
votes
1 answer

Django - deterministic=True requires SQLite 3.8.3 or higher upon running python manage.py runserver

I am running a linux red hat environment from AWS. I have followed every instruction for upgrading sqlite3 to the "latest" version. I am running python 3.9.2 (and have recompiled it with LD_RUN_PATH=/usr/local/lib ./configure) and django version…
ShanerM13
  • 464
  • 4
  • 10
8
votes
1 answer

Interpreter crashes trying to use tkinter library

I have tried to staring the application in VSCODE by Python3. This is the code: from tkinter import * window = Tk() window.mainloop() only 3 lines :)), but when I'm trying to execute the file in terminal it will give me an error, which you can see…
7
votes
1 answer

When running python 3.9.4 I am unable to import tkinter, but downgrading to 3.8.2 works perfectly fine

Im on macOS Catalina running tcl 8.6.11, I installed python3 using brew install python3 tclsh % info patchlevel 8.6.11 Current version of python 3.9.4 python3 --version Python 3.9.4 >>> import tkinter import _tkinter # If this fails your Python…
Aditya Garg
  • 757
  • 4
  • 16
5
votes
2 answers

Python how to type anotate a method that returns self?

Suppose I have a class that implements method chaining: from __future__ import annotations class M: def set_width(self, width: int)->M: self.width = width return self def set_height(self, height: int)->M: …
mousetail
  • 3,383
  • 1
  • 15
  • 28
5
votes
2 answers

What is __phello__ for in Python 3?

I imported __phello__ in the terminal: >>> import __phello__ Hello world! What is __phello__ for? Or is it just an Easter Egg?
Abhigyan Jaiswal
  • 2,090
  • 1
  • 5
  • 22
5
votes
1 answer

Is there a way to use Python 3.9 type hinting in its previous versions?

In Python 3.9 we can use type hinting in a lowercase built-in fashion (without having to import type signatures from the typing module) as described here: def greet_all(names: list[str]) -> None: for name in names: print("Hello",…
kbnt
  • 63
  • 4
5
votes
3 answers

Is there a __dunder__ method corresponding to |= (pipe equal/update) for dicts in python 3.9?

In python 3.9, dictionaries gained combine | and update |= operators. Is there a dunder/magic method which will enable this to be used for other classes? I've tried looking in the python source but found it a bit bewildering.
evanr70
  • 109
  • 6
4
votes
1 answer

Why does using the walrus operator on a member variable raise a SyntaxError?

Why can't I use the walrus operator := to assign to an attribute? It works when assigning to a local variable: my_eyes = ["left", "right"] if saved_eye := my_eyes.index("left"): print(saved_eye) # outputs >>> 0 But it is a syntax error if I…
1
2 3
30 31