adap / flower

Flower: A Friendly Federated Learning Framework
https://flower.ai
Apache License 2.0
4.92k stars 848 forks source link

feat(framework) Implement `keys/values/items` methods for `TypedDict` #4146

Closed panh99 closed 2 weeks ago

panh99 commented 3 weeks ago

Previously, as pointed out by @jafermarq , the string representation of entire TypedDict will show up when printing out the return of .keys() / .values(), as follows: image

To optimize the string representations, I implemented keys(), values() and items() methods for TypedDict instead of just inheriting them from the superclass MutableMapping. Now, we have: image