Is there something similar to Pylint, that will look at a Python script (or run it), and determine which version of Python each line (or function) requires?
For exam
The tool pyqver from Greg Hewgill wasn't updated since a while.
vermin is a similar utility which shows in the verbose mode (-vvv) what lines are considered in the decision.
% pip install vermin
% vermin -vvv somescript.py
Detecting python files..
Analyzing using 8 processes..
!2, 3.6 /path/to/somescript.py
L13: f-strings require 3.6+
L14: f-strings require 3.6+
L15: f-strings require 3.6+
L16: f-strings require 3.6+
print(expr) requires 2+ or 3+
Minimum required versions: 3.6
Incompatible versions: 2
Bonus: With the parameter -t=V you can define a target version V you want to be compatible with. If this version requirement is not met, the script will exit with an exit code 1, making it easy integratable into a test suite.