[Python-Dev] PEP 550 v4
Ethan Furman
ethan at stoneleaf.us
Sat Aug 26 17:10:47 EDT 2017
On 08/26/2017 12:12 PM, David Mertz wrote:
> I'm convinced by the new section explaining why a single value is better than a namespace. Nonetheless, it would feel
> more "Pythonic" to me to create a property `ContextVariable.val` whose getter and setter was `.lookup()` and `.set()`
> (or maybe `._lookup()` and `._set()`).
>
> Lookup might require a more complex call signature in rare cases, but the large majority of the time it would simply be
> `var.val`, and that should be the preferred API IMO. That provides a nice parallel between `var.name <http://var.name>`
> and `var.val` also.
+1 to the property solution.
--
~Ethan~
More information about the Python-Dev
mailing list