smithy-lang / smithy-python

Smithy code generators and core modules for Python (in development)
Apache License 2.0
47 stars 10 forks source link

Add length and repr to fields #230

Closed nateprewitt closed 4 months ago

nateprewitt commented 4 months ago

This PR adds some minor usability dunders to the Fields class to allow us to verify the total number of Field entries in a Fields instance and represent those values in the __repr__.

nateprewitt commented 4 months ago

We generally don't have our other repr's tested since it's an established format of Class(<Collection>) with a straight-forward f-string. We could add one though if you think there's concern in regressing it.