@@ -341,30 +341,30 @@ def count_genai(d: Dict[str, int], e: Example):
341341# Path to the JSON, which was not very secure
342342# and arguably not useful either.
343343class DocGenEncoder (json .JSONEncoder ):
344- def default (self , obj ):
345- if is_dataclass (obj ) and not isinstance (obj , type ):
346- return asdict (obj )
344+ def default (self , o ):
345+ if is_dataclass (o ) and not isinstance (o , type ):
346+ return asdict (o )
347347
348- if isinstance (obj , Path ):
348+ if isinstance (o , Path ):
349349 # Strip out paths to prevent leaking environment data.
350- return obj .name
350+ return o .name
351351
352- if isinstance (obj , MetadataErrors ):
353- return {"__metadata_errors__" : [asdict (error ) for error in obj ]}
352+ if isinstance (o , MetadataErrors ):
353+ return {"__metadata_errors__" : [asdict (error ) for error in o ]}
354354
355- if isinstance (obj , EntityErrors ):
355+ if isinstance (o , EntityErrors ):
356356 return {
357- "__entity_errors__" : [{error .entity : error .message ()} for error in obj ]
357+ "__entity_errors__" : [{error .entity : error .message ()} for error in o ]
358358 }
359359
360- if isinstance (obj , Fs ):
360+ if isinstance (o , Fs ):
361361 # Don't serialize filesystem objects for security
362362 return {}
363363
364- if isinstance (obj , set ):
365- return {"__set__" : list (obj )}
364+ if isinstance (o , set ):
365+ return {"__set__" : list (o )}
366366
367- return super ().default (obj )
367+ return super ().default (o )
368368
369369
370370def parse_config (doc_gen : DocGen , root : Path , config : Path , strict : bool ):
0 commit comments