[Python-Dev] Story behind vars() vs .__dict__

2020-12-21 Thread Paul Sokolovsky
Hello,

I would easily bet 10 bucks that vars() is the least known, and least
used, of the Python builtin functions.

My mental model of it was: it was introduced (perhaps in Python3) to
"harmonize" all the existing .__dict__ stuff, and provide more
abstract interface for it, with .__dict__ patiently waiting its
deprecation in CPython 10 or something.

Was I wrong with thinking like that, and finding that vars() was
already in the docs of CPython 1.4, the earliest doc version hosted at
python.org:
https://docs.python.org/release/1.4/lib/node26.html#SECTION0033 
 

So it seems it was around "always", but then the question is why both
vars() and .__dict__ are round for so long, and there was no
(successful) attempt to stop breaking object encapsulation e.g. on
transitioning to Python3000? Anybody has any references to the story of
them? I can't find anything relevant so far. I in particular made sure
to google for "vars site:python-history.blogspot.com" with 0 hits.

Expected clarification on ".__dict__ breaking object encapsulation":
Usually, object attributes are used to access "some small piece of data"
"stored inside" an object. .__dict__ is not like that. Depending on how
you look at it, its either-or:

1. A *metadata* about an object (object's representation as a dict),
and then it makes sense to use a dedicated access means for that
metadata, exactly what vars() provides.
2. Leak of an implementation detail, because a particular Python
implementation uses a dict as internal storage for modules, classes,
instances, and then .__dict__ just gives blatant access to this
internal storage, bypassing normal object semantics.

-- 
Best regards,
 Paul  mailto:[email protected]
___
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/JAFIBBUU5UE7VMX3SFYXQOHNK6TDZBV3/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] CPython codebase plots

2020-12-21 Thread Pablo Galindo Salgado
Hi,

The year is almost over and plenty of internet services are generating the
“2020 in review” summary so I hope everyone is in the mood
for some extra summary plots. I have generated some “CPython lifetime in
review” plots that I hope you enjoy.

You can check them out here:

https://discuss.python.org/t/cpython-codebase-plots/6267

Regards from cloudy London,
Pablo Galindo Salgado
___
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/O6M3QBPUDCIBV3FF2VGRRHGCZJLJVC3T/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: Story behind vars() vs .__dict__

2020-12-21 Thread Greg Ewing

On 22/12/20 12:36 am, Paul Sokolovsky wrote:

Expected clarification on ".__dict__ breaking object encapsulation":


Encapsulation is not something that Python has ever been big
on. There are plenty of places where implementation details are
exposed, and we don't regard that as a problem.

--
Greg
___
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/BFK7LTKHZ5JLEKUPZXF5AQ3WMGODL4F5/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: Story behind vars() vs .__dict__

2020-12-21 Thread Paul Sokolovsky
Hello,

On Tue, 22 Dec 2020 01:10:17 +1300
Greg Ewing  wrote:

> On 22/12/20 12:36 am, Paul Sokolovsky wrote:
> > Expected clarification on ".__dict__ breaking object
> > encapsulation":  
> 
> Encapsulation is not something that Python has ever been big
> on. There are plenty of places where implementation details are
> exposed, and we don't regard that as a problem.

That's still not the reason to e.g. make the value of the proverbial
LOAD_METHOD opcode be available via dict type attribute, like:
dict.LOAD_METHOD. Or for that matter, not the reason to provide
object's internal storage via object's attribute: obj.__dict__.

But the question was about (thru-the-time) relationship of vars()
vs .__dict__ ...


-- 
Best regards,
 Paul  mailto:[email protected]
___
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/KI2M2GO4MD6G3GZWP6KP5XQRVHVGWP4I/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] [RELEASE] Python 3.8.7 is now available

2020-12-21 Thread Łukasz Langa
Python 3.8.7 is the seventh maintenance release of Python 3.8. Go get it here:

https://www.python.org/downloads/release/python-387/ 

Note: this is a bugfix release for the 3.8 series which was superseded by 
Python 3.9, currently the latest feature release series of Python 3. You can 
find the latest release of 3.9.x here .

Maintenance releases for the 3.8 series will continue at regular bi-monthly 
intervals, with 3.8.8 planned for February 2021.

macOS 11 Big Sur not fully supported

Python 3.8.7 is not yet fully supported on macOS 11 Big Sur. It will install on 
macOS 11 Big Sur and will run on Apple Silicon Macs using Rosetta 2 
translation. However, a few features do not work correctly, most noticeably 
those involving searching for system libraries (vs user libraries) such as 
ctypes.util.find_library() and in Distutils. This limitation affects both Apple 
Silicon and Intel processors. We are looking into improving the situation for 
Python 3.8.8.

Python 3.9.1  provides 
full support for Big Sur and Apple Silicon Macs, including building natively on 
Apple Silicon Macs and support for universal2 binaries.

What’s new?

The Python 3.8 series contains many new features and optimizations over 3.7. 
See the “What’s New in Python 3.8 
” document for more information 
about features included in the 3.8 series.

Detailed information about all changes made in version 3.8.7 specifically can 
be found in its change log 
. 
Note that compared to 3.8.6 this release also contains all changes present in 
3.8.7rc1.

We hope you enjoy Python 3.8!

Thanks to all of the many volunteers who help make Python Development and these 
releases possible! Please consider supporting our efforts by volunteering 
yourself or through organization contributions to the Python Software 
Foundation.

Your friendly release team,
Ned Deily @nad 
Steve Dower @steve.dower 
Łukasz Langa @ambv ___
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/MMLVSZLBWXUCX2UTBIEV7PTPVQA4BCZW/
Code of Conduct: http://python.org/psf/codeofconduct/