smithy-lang / smithy-python

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

Update explicit set/get/remove functions to use native dunder methods #233

Closed nateprewitt closed 4 months ago

nateprewitt commented 4 months ago

This PR proposes simplifying our Fields interface to use more idiomatic methods for accessing, setting, and removing Field entries. The original implementation was strictly following the Cross-SDK specification but creates an unintuitive user experience for Python developers. We could also keep the existing methods and alias them to the dunder implementations, but it seems like clutter and confusing imo.