Questions tagged [python-3.11]

Python 3.11 is the newest release of the Python language. Please use the [python] tag for general Python related questions.

Python is an interpreted, high-level and general-purpose programming language. Python's design philosophy emphasizes code readability with its notable use of significant indentation.

References

308 questions
5
votes
2 answers

except* fails on unhashable exceptions - documented behaviour or a bug?

Consider the following code block: class MyException(Exception): __hash__ = None try: raise ExceptionGroup("Foo", [ MyException("Bar") ]) except* Exception: pass The except* should catch any number of exceptions of any…
J E K
  • 112
  • 5
4
votes
4 answers

how to install Ta-lib with python 3.11 in Windows?

TA-Lib windows distribution from here https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib, but only support to 3.10. How to install Ta-lib with python 3.11 in Windows? Instructions from the README for installing on Windows: Download…
zgpnuaa
  • 51
  • 1
  • 3
4
votes
0 answers

Fatal Error: init_fs_encoding: failed to get the Python codec of the filesystem encoding

Trying to run Python 3.11 on CentOS 7 and keep getting this error block anytime I invoke python3.11. Could not find platform independent libraries Could not find platform dependent libraries Python path configuration: …
mikeyw
  • 41
  • 1
4
votes
0 answers

Support for tensor type hints (variadic generics) in Numpy (PEP 646)

Context: As of Python 3.11, variadic generics are supported as detailed in PEP 646. The idea behind variadic generics is to facilitate the annotation of tensors (or multiple dimensional arrays), like this example (from PEP 646): def to_gray(videos:…
Hylke
  • 75
  • 6
4
votes
2 answers

What is the type of sum?

I want to express that the first parameter is a "list" of the second parameter, and that the result has the same type as the second parameter. This mysum (ie. not the standard lib sum) should work equally well with int/float/str/list, and any other…
thebjorn
  • 26,297
  • 11
  • 96
  • 138
3
votes
0 answers

Python 3.11 poor time.sleep resolution on Windows

Python 3.11 introduces a high-resolution timer for time.sleep on Windows. Previously, the best sleep resolution was 1ms (although in practice it was often 16ms unless you engaged in winmm timeBeginPeriod trickery). Upon upgrading to Python 3.11, I…
3
votes
2 answers

Google secret manager is throwing "Invalid constructor input for AccessSecretVersionRequest" with python3.11 and secret-manager 2.16.0

Below code snippet is throwing exception Invalid constructor input for AccessSecretVersionRequest from google.cloud import secretmanager from google.oauth2 import service_account client = secretmanager.SecretManagerServiceClient() name =…
Ravi
  • 198
  • 1
  • 1
  • 8
3
votes
1 answer

ImportError: cannot import name 'build_py_2to3' from 'distutils.command.build_py'

I tried to install bipwallet through pip but it says there is no 'build_py_2to3' in distutils Defaulting to user installation because normal site-packages is not writeable Collecting bipwallet ... Collecting protobuf==3.0.0a3 Using cached…
Orkhan
  • 33
  • 1
  • 3
3
votes
3 answers

pyFirmata gives error: module 'inspect' has no attribute 'getargspec'

I'm trying to use pyFirmata, but I can't get it to work. Even the most basic of the library does not work. I guess there is something wrong with the library code. from pyfirmata import Arduino,util import time port = 'COM5' board = Arduino(port) I…
clueless
  • 33
  • 1
  • 3
3
votes
1 answer

Why does this specific piece of code using random.random run slower in Python 3.11 than in Python 3.10.6?

I'm just curious to hear other people's thoughts on why this specific piece of code might might run slower in Python 3.11 than in Python 3.10.6. Cross-posted from here. I'm new here - please kindly let me know if I'm doing something wrong. test.py…
mh0w
  • 91
  • 7
3
votes
1 answer

Why is there `pip3.10.exe` in `Python311\Scripts`

As you can see below, after I installed Python 3.11, I came to the realization that running pip3.10 freeze did not list me the packages I had in my Python 3.10.2 but those of my Python 3.11. This is explained by the fact that in Python311\Scripts I…
2
votes
0 answers

Subclassing typing.Any

The documentation for typing.Any says Changed in version 3.11: Any can now be used as a base class. This can be useful for avoiding type checker errors with classes that can duck type anywhere or are highly dynamic. What kind of errors is this…
Daniel Walker
  • 6,380
  • 5
  • 22
  • 45
2
votes
1 answer

Why does pypdf stuff text with extra spaces when extracting text?

pypdf==3.11.0, like previous versions, returns text strings with the occasional inserted single space. But Windows Search and the "Find" in Adobe reader find the text unadulterated, and if you try finding the text string with the extra spaces…
PMSK
  • 61
  • 4
2
votes
1 answer

How to apply @enum.nonmember?

I was trying to come up with a use case for the new @enum.nonmember decorator in Python 3.11. The docs clearly mention it is a decorator meant to be applied to members. However, when I tried literally decorating a member directly: import…
bad_coder
  • 11,289
  • 20
  • 44
  • 72
2
votes
1 answer

Why is the outconverter not called for byte conversions in oracledb/cx_Oracle (Python)?

I am trying to fetch SDO_GEOMETRY typed columns from an Oracle database using Python (3.11) and the oracledb library (1.3.0). I want to use an outputtypehandler to convert the SDO_GEOMETRY instances into pickle encoded bytes. This works fine for…
Jannis
  • 23
  • 4
1
2
3
20 21