File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change
1
+ RELEASE_TYPE: patch
2
+
3
+ Fixes a substantial performance regression in stateful tests from computing string representations, present since :ref: `version 6.131.20 <v6.131.20 >`.
Original file line number Diff line number Diff line change @@ -453,7 +453,7 @@ def get_pretty_function_description(f: object) -> str:
453
453
return pretty (f )
454
454
if not hasattr (f , "__name__" ):
455
455
return repr (f )
456
- name = f .__name__ # type: ignore # validated by hasattr above
456
+ name = f .__name__ # type: ignore
457
457
if name == "<lambda>" :
458
458
return extract_lambda_source (f )
459
459
elif isinstance (f , (types .MethodType , types .BuiltinMethodType )):
Original file line number Diff line number Diff line change @@ -504,8 +504,12 @@ def __post_init__(self):
504
504
self .bundles = tuple (bundles )
505
505
506
506
def __repr__ (self ) -> str :
507
- rep = get_pretty_function_description
508
- bits = [f"{ k } ={ rep (v )} " for k , v in dataclasses .asdict (self ).items () if v ]
507
+ bits = [
508
+ f"{ field .name } ="
509
+ f"{ get_pretty_function_description (getattr (self , field .name ))} "
510
+ for field in dataclasses .fields (self )
511
+ if getattr (self , field .name )
512
+ ]
509
513
return f"{ self .__class__ .__name__ } ({ ', ' .join (bits )} )"
510
514
511
515
You can’t perform that action at this time.
0 commit comments