When I set a field to None in an arcpy script, it shows as None in the attribute table rather than <Null> when using an UpdateCursor. Why does it set it to a text value of "None" rather than <Null>?
# ---------------------------------------------------------------
# Loop through NEW to OLD spatial join results
# If attributes don't match, then show the differences in the
# new Changes_ attribute fields.
# ---------------------------------------------------------------
with arcpy.da.UpdateCursor(
fc, fields, where_clause = "Join_Count=1"
) as cursor:
for row in cursor:
myADDR = ""
#Compare L_F_ADD = L_F_ADD_1 and L_T_ADD = L_T_ADD_1 and R_F_ADD = R_F_ADD_1 and R_T_ADD = R_T_ADD_1
if row[4] != row[24]:
myADDR += "L_F_ADD (new = old): " + str(row[4]) + "=" + str(row[24]) + " | "
if row[5] != row[25]:
myADDR += "L_T_ADD (new = old): " + str(row[5]) + "=" + str(row[25]) + " | "
if row[6] != row[26]:
myADDR += "R_F_ADD (new = old): " + str(row[6]) + "=" + str(row[26]) + " | "
if row[7] != row[27]:
myADDR += "R_T_ADD (new = old): " + str(row[7]) + "=" + str(row[27]) + " | "
if myADDR == "":
myADDR = None
row[43] = myADDR
cursor.updateRow(row)