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~
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com