Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot import "deprecated" class from warnings module

Tags:

python

I am using code similar to

from warnings import deprecated

@deprecated
def test():
    print("test")

test()

I am getting an error (python 3.11) with "cannot load deprecated from warnings" and I was wondering if anybody knows why that is.

I noticed that warnings.py does infact have that class

like image 215
Barry Avatar asked Aug 15 '26 22:08

Barry


1 Answers

AFAIK, this new decorator is only available for python 3.13 right now.

like image 199
Eduardo García Pérez Avatar answered Aug 17 '26 12:08

Eduardo García Pérez



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!