[Python-Dev] PEP 549: Instance Properties (aka: module properties)

Neil Schemenauer nas at arctrix.com
Thu Sep 7 14:14:12 EDT 2017


Larry Hastings <larry at hastings.org> wrote:
> The TL;DR summary: add support for property objects to modules.
> I've already posted a prototype.

I posted an idea to python-ideas about lazy module loading.  If the
lazy loading idea works, having properties would allow modules to
continue to be "lazy safe" but to easily do init logic when needed,
e.g. getting of the property.

There should be a very clean way to do that, IMHO.  Using __class__
is not clean and it would be unfortunate to have the __class__
song-and-dance in a bunch of modules.  Using property() seems more
Pythonic.



More information about the Python-Dev mailing list