Do you mean Pyhton 3.6+?
I can say for experience that some of the arcpy tools in Python 3.7 (ArcGIS Pro 2.9) that some of the tools accept f-string as parameters other does not:
This example does not work (using the f-string in the where_clause parameter):
where_clause_with_date_filter = f"{where_clause} AND {date_filter}"
points_select = arcpy.analysis.Select("{0}.{1}".format(schema_owner, TABLE_CAL_POINTS), r"memory\f{0}".format(uuid4().hex),where_clause_with_date_filter)
generates the error:
File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\Resources\ArcPy\arcpy\analysis.py", line 138, in Select
raise e
File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\Resources\ArcPy\arcpy\analysis.py", line 135, in Select
retval = convertArcObjectToPythonObject(gp.Select_analysis(*gp_fixargs((in_features, out_feature_class, where_clause), True)))
File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 512, in <lambda>
return lambda *args: val(*gp_fixargs(args, True))
arcgisscripting.ExecuteError: ERROR 000358: Invalid expression f"{where_clause} AND {date_filter}"
Failed to execute (Select).
i have tried to use the f-string in search cursor, and update cursor and found that in the feature_class parameter,m it does not accept f-strings, but in the where_clause it does:
with arcpy.da.UpdateCursor("{0}.{1}".format(schema_owner, TABLE_LINKAGES),
["REFERENCE_FEATURE_ID"],
where_clause=f"PROJECT_ID = '{project_id}'") as cursor: