Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

My Python 3.11 did not use new error message

I’m using Python 3.10 for my daily driver because of some dependency. Now, I just download Python 3.11, install it, and successfully use environment.

(env311) PS D:\user\package> py
Python 3.11.6 (tags/v3.11.6:8b6ee5b, Oct  2 2023, 14:57:12) [MSC v.1935 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

I install it because I want to utilize the new error message pointer. But, why is this that I got?

>>> import itertools
>>> 
>>> c = itertools.counter()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'itertools' has no attribute 'counter'. Did you mean: 'count'?

It didn’t produce better error message claimed at this and this like this:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Traceback (most recent call last):
  File "util.py", line 3, in <module>
    c = itertools.counter()
        ^^^^^^^^^^^^^^^^^
AttributeError: module 'itertools' has no attribute 'counter'. Did you mean: 'count'?

EDIT 1

Thanks for the answer. If by chance any of you know how to enable it on jupyter notebook or other mode, greatly appreciated. For now, I can port my notebooks to scripts.

>Solution :

You’re in interactive mode. The functionality you’re looking for only works when a source file is available. It doesn’t work for statements typed in interactively.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading