I have a Django app written in Python 2.5 and I plan to upgrade it to be compatible with Python 2.6. It contains hundreds of .py files. Is there a simple way to find all deprecated functions in those files?
Python deprecated functions
pythonpython-2.6
Related Topic
- Python – What are metaclasses in Python
- Python – How to safely create a nested directory in Python
- Python – Does Python have a ternary conditional operator
- Python – the quickest way to HTTP GET in Python
- Python – Proper way to declare custom exceptions in modern Python
- Python – Dealing with multiple Python versions and PIP
- Python – Does Python have a string ‘contains’ substring method
- Python – String formatting: % vs. .format vs. f-string literal
Best Answer
I'm not sure what you mean by "deprecated functions" when upgrading from Python 2.5 to Python 2.6.
The release notes are very specific. http://docs.python.org/whatsnew/2.6.html
There are no deprecated functions. A few whole modules are deprecated, and one attribute of the Exception class.
You have GREP (or FIND) and you have PYTHON which you can use to search 100's of files of Python source.
When we made the change from 2.5 to 2.6 we had zero issues with deprecated functions.
Deprecated means "still works".
We had exactly one deprecated module, and it was reported during our unit testing via a warning message. We simply read the log for deprecation messages and replaced the module. (It was
md5
, by the way.) Eventually, we did a GREP for all uses ofmd5
and replaced them.