ArcGIS Pro 3.1 (also same error tested on 2.9)
Getting an AttributeError when using arcpy.AddMessage() to print the default values for fields.
AttributeError: Object: Error in parsing arguments for AddMessage
Original code...
import arcpy
## path to feature class
fc = r"C:\Path\To\GDB\FeatureClass"
## describe the data and return a dictionary
desc = arcpy.da.Describe(fc)
## for each field object in the fields property
for field_obj in desc["fields"]:
## print the field name
arcpy.AddMessage(field_obj.name)
## print the field defaultValue
arcpy.AddMessage(field_obj.defaultValue)