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

Chris Barker chris.barker at noaa.gov
Mon Sep 11 13:00:15 EDT 2017

On Thu, Sep 7, 2017 at 3:49 PM, Larry Hastings <larry at hastings.org> wrote:

>  But I can cite at least one place in the standard library that would have
> been better if it'd been implemented as a module property:
I wish there were a property feature available almost very time I encounter
a "get*" method in the stdlib (or any where):

There are a heck of a lot in the os module:

In [4]: [s for s in dir(os) if s.startswith('get')]


Many of those may be good use-cases for getters, but still...

And just yesterday I was getting annoyed by some in sysconfig:

In [6]: [s for s in dir(sysconfig)  if s.startswith('get')]


modules serve the very useful function of a global singleton -- if we think
properties are a good idea for classes, then they are a good idea for



Christopher Barker, Ph.D.

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20170911/0af81dbc/attachment.html>

More information about the Python-Dev mailing list